TAIPEI, Taiwan — It seemed at first like a freak accident.

A contractor was navigating a sharp turn on a sand-packed road. He had been hired to shore up a steep hillside on Taiwan’s east coast — any falling debris could be a safety hazard to the trains that rushed by below.

At the edge of the embankment, his truck got stuck. He and another worker tried to pull it free, using a cloth strap and an excavator. The strap snapped, and the truck tumbled down the hill onto the railway tracks.

About a minute later, Taroko Express No. 408 collided with the truck, killing 49 people and injuring more than 200.

In an instant, the picturesque oceanside slope became the site of Taiwan’s deadliest railway disaster in seven decades.

The tragedy on that April morning is one of several crises that have shaken this island democracy of 23.5 million people, which prides itself as a well-managed and accountable society. It has undermined confidence in the government at a time when Taiwan has struggled with a surge in coronavirus cases and rolling electrical blackouts.

While prosecutors have accused the contractor, Lee Yi-hsiang, and others of negligent homicide, the roots of the disaster go much deeper, revealing systemic failures at the government agency that runs the train system, the Taiwan Railways Administration.

A close examination of the crash by The New York Times, based on interviews with current and former officials, railway employees, contractors and safety experts, found that the agency suffered from a culture of complacency and weak oversight. Contractors like Mr. Lee were mismanaged, maintenance problems festered, and officials missed or ignored safety warnings — creating conditions that contributed to the crash.

A government adviser told officials in 2017 that the line on which the crash occurred was an accident waiting to happen.

Earlier this year, a local worker for the agency twice warned about the risk of heavy equipment maneuvering around that same turn. No one did anything. The authorities are investigating whether the agency should have done more to follow up, Chou Fang-yi, a prosecutor on the case, told The Times.

Mr. Lee should never have been awarded the project under the agency’s rules. According to the indictment, he illegally misrepresented his company on the application, using the credentials of a larger, more experienced company to qualify for the project. The agency did not do enough due diligence to uncover the problem.

“This accident could have been avoided,” Li Kang, a member of the Taiwan Transportation Safety Board, a government agency investigating the crash, said in an interview.

Since the disaster, Taiwan’s president, Tsai Ing-wen, has vowed to address longstanding complaints about the Taiwan Railways Administration, which provided more than 500,000 rides per day before the pandemic.

A report by Taiwan’s transportation ministry released on Sunday cited failings in the railway agency’s safety processes and management of construction projects.

The railway agency said it was undertaking reforms. In May, it reprimanded 12 employees for “inadequate supervision and management” of the project at the crash site, though none were dismissed.

In a written response to questions, the agency said the reprimands were a “warning and a chance for public servants to reflect on their failure to properly fulfill their duties.”

Past promises to improve have had little result. Ms. Tsai’s government called for reforms in 2018 after a train crash in the northeast killed 18 people. Although some recommendations were instituted, structural changes were not.

Since 2012, the agency’s trains have experienced 316 major incidents, including collisions and derailments, according to a review by The Times of data from Taiwan’s transportation ministry. The accidents have killed 437 people.

By comparison, Taiwan High Speed Rail, the newer, public-private high-speed system on the island’s west coast, had no major incidents during the same period.

“Typically when there is an accident, T.R.A.’s response is to hold a meeting, discuss, organize a lecture and an exercise and tell workers that this is the correct protocol,” said Lu Chieh-shen, who worked at the agency for 38 years and served as general director from 2016 to 2018. “Then they go back to their routine.”

On the morning of April 2, Mr. Lee, the contractor, was not supposed to be working.

It was Tomb Sweeping Day, a holiday when people honor their ancestors. But he was behind schedule and did not want to get fined for missing his deadline, prosecutors say.

He enlisted several other workers, but there were no outside safety supervisors monitoring the site, as government rules required.

At least twice before, construction vehicles had become lodged on the same road where Mr. Lee’s truck got stuck trying to make the turn, according to the indictment. In January, a railway agency worker warned the project’s safety supervisors to improve the road’s grade and surface and install protective fencing. It wasn’t done.

Mr. Lee should not have been awarded the project in the first place.

When the Taiwan Railways Administration was looking for contractors to reinforce the slope in 2019, his two companies were ineligible because they lacked experience with that kind of work.

So Mr. Lee used the license of a larger company, Tung Hsin Construction, to apply, though it was illegal to do so, according to the indictment. In return, prosecutors say, he offered the larger company part of the profits.

Contractors and experts who spoke with The Times said the agency frequently awarded contracts to the lowest bidder, prioritizing savings over safety. The emphasis on cost, two contractors said, deterred more reputable companies from bidding.

The agency “believes in using cheap labor to perform high-risk operations,” said Chen Hong-shan, a contractor who has worked on several projects for the railway administration. “This has been the practice for decades.”

He added that because agency budgets often allocated too little for safety measures, contractors had to cut corners to make projects profitable, compromising the work.

The agency, in its written response, said that while some contracts were awarded to the lowest bidder, others went to the “most advantageous” one. In those cases, the agency said, a contractor’s safety record and experience were deciding factors.

Mr. Lee regularly won contracts despite having a spotty record.

In 2009, one of Mr. Lee’s companies, Yi-hsiang Industry, was blacklisted for a year over procurement rule violations, according to government records. Since 2013, the authorities have fined his companies a combined 35 times for various infractions involving vehicles, according to a Times review of data. In 2018, Mr. Lee was sentenced to six months in prison for falsifying documents about the progress of a project.

Still, starting in 2013, Mr. Lee was legitimately awarded at least 48 contracts, totaling nearly $10 million, with the railway agency and other government entities, according to a review of procurement data. That total does not include the $4.6 million contract for the slope reinforcement project.

In all, Mr. Lee was awarded nine contracts by the railway agency, including the slope project. In each case, his was the lowest bid, according to the data.

Prosecutors have accused Mr. Lee and six others of criminal liability; four were charged with negligent homicide. If convicted of all charges, Mr. Lee could face up to 12 years in prison.

In 2017, Liao Ching-lung, a railway safety expert and government adviser, was studying video of a 2016 train derailment on Taiwan’s east coast when he noticed something alarming: the track was in terrible condition.

Concerned, he requested a meeting with transportation ministry officials.

“I told them it was only a matter of time before there was an accident on the track,” he said.

Mr. Liao’s warning was prescient. In 2018, the Puyuma Express, another train operated by the railway agency, derailed on that same route, called the Northern Loop line, killing 18 people. And the April crash occurred on the same line.

Although an investigation into the Puyuma crash by the Taiwan Transportation Safety Board blamed the driver for disabling an automatic speed warning system, the board’s report also flagged endemic problems at the agency, saying it routinely skipped or postponed repairs and maintenance on cars and tracks in order to keep trains running on schedule.

It also cited the agency’s failure to provide workers with adequate equipment and safety training. The way the agency is organized “may cause business concern to be prioritized over railroad safety in decision making,” the board warned in its final report, released last year.

Investigators for the board told The Times that the agency had not thoroughly implemented the changes that it said it had. For example, the agency, despite its claims, still has no formal, comprehensive process for reporting maintenance issues, said Mr. Li, one of the investigators.

“They had only accepted the changes on paper — they did not put them into practice,” said Young Hong-tsu, the safety board’s chairman.

After the Taroko Express crash in April, the labor ministry audited 195 ongoing railway agency projects and found 306 instances of safety violations on construction sites. They included failure to install protective fencing and to conduct proper risk assessments. Work was suspended in 15 cases.

Once the crown jewel of Taiwan’s transportation network, the railway agency is now, in many ways, an ossified relic. Its history as a beloved institution — famous for the Japanese-style architecture at some stations and for its boxed meals, known as railway bentos — has made change politically difficult.

“Within T.R.A., people like to joke that the agency is very good at selling bento boxes but doesn’t care about workplace safety,” said Huang Te-hui, a maintenance worker for the agency.

Even as transportation options on the island have proliferated, efforts to make the agency more efficient and profit-oriented have stalled. Powerful constituencies, including unions and politicians, have shielded it from accountability and prevented desperately needed operational and management changes, its critics say.

“For nearly a century, T.R.A. has played an important role in the distribution of political benefits,” said Hochen Tan, who was Taiwan’s transportation minister from 2016 to 2018.

Attempts to raise ticket prices have been blocked by elected officials who feared the political fallout. Fares have gone unchanged for about 25 years, while costs have risen. Resistance from local residents, as well as officials wanting to maintain links to their communities, has left the agency saddled with unprofitable routes. And few have dared to take on the issue of its swelling employee pensions.

As a result, the agency has struggled to stay financially afloat. Its current deficit is around $14 billion.

Since the April crash, the agency has said it would install more barriers along tracks to catch falling debris, as well as sensors to warn drivers of potential obstacles. It also said it would use surveillance technology to better monitor construction sites. The government plans to give more than $500,000 to the family of each person who died in the crash.

Credit…Chen Peng-nian

Among the families, there are fears that the 49 lives lost on that day have become not a call to action, but another missed opportunity to bring about needed change.

Chen Peng-nian, 38, was among the hundreds trapped in the wreckage. He and his family — his parents, sister and two children — had been in the third carriage from the front, on their way to their ancestral home near the city of Taitung.

Injured, he groped around in the darkness until he found a mobile phone to use as a flashlight. He saw his mother holding his son, who was bleeding, and his father nearby.

His sister was slumped lifeless on the other side of the car. Only a short time before, he had been taking pictures of her with his daughter, Yan-yi, who was 4. In one photo, Yan-yi is smiling, wearing a pink and white polka-dot hat with ears. She was thrown from the train and died.

“They call for reform, improvements — I can say all these things, too,” Mr. Chen said in an interview, referring to Taiwan’s leaders. “But what are they actually doing? I have no idea.”