Railroads own their tracks and are responsible for their maintenance and regular inspection. Ms. Feinberg said the agency had asked the railroad industry and other stakeholders in 2012 to come up with recommendations about setting new standards to address track safety but had failed to reach a consensus on the issue.

Since then, Ms. Feinberg said she had repeatedly made the case that track safety was an issue that needed to be addressed.

“You cannot contract away your safety responsibilities,” she said. “Railroads are accountable for their tracks. Anyone in industry saying they are surprised by this hasn’t been paying attention.”

The railroad agency said that CSX had agreed to set up a new system within 180 days in which rail inspectors would be able to review data from past inspections in real time as they review their tracks so they can better identify areas where conditions may have worsened.

According to the agency investigation, Sperry Rail Service conducted internal rail inspections required by law twice before the accident — on Dec. 17, 2014, and Jan. 12, 2015. Both times, the inspections revealed internal rail flaws at the derailment site.

But in each case, the operator did not take action, or get out of his inspection vehicle, in the mistaken belief that the defects were caused by surface conditions on the rail. The law requires inspectors to exit their inspection vehicles and verify the indication with an on-the-ground, hand-held ultrasonic instrument.

The agency said its investigation disclosed that the rail was near CSX’s acceptable wear limit.

In response, CSX said Friday that it had the lowest rate of mainline derailments caused by track defects. The company said that it would begin “run-over-run comparisons” of current inspection results of a track section with previous inspections “to increase the likelihood that defects will be identified before they become safety-critical.”

“CSX has fully complied with all regulations pertaining to crude oil transportation and other aspects of rail safety,” CSX said in a statement. “In addition, we are committed to continuously improving our ability to detect and correct rail defects before they can cause an incident.”