Last night's fatal Amtrak derailment in Philadelphia is certain to rekindle the longstanding debate over what to do with a national rail system that's constantly over budget and behind schedule. Caught between increasing ridership and flat funding in recent years, Amtrak has been forced to choose between running the trains on time, or running them safely. Data from the Federal Railroad Administration suggests they've recently opted for the latter, as the accident rate has been in decline.

The following chart shows Amtrak's accident rate over the past 40 years, as well as what caused the accidents. Important to note: these numbers don't include accidents between trains and vehicles at railroad crossings. Since many of those collisions are not necessarily anything that Amtrak can control (think of a car stalled on the tracks, for instance), the Federal Railroad Administration doesn't include them in its official tallies.

Overall, Amtrak is experiencing fewer accidents per year in recent years, according to the FRA. Between 2000 and 2014, Amtrak's total accident rate per million passenger miles dropped by more than half, from 4.1 to 1.7. Numbers currently stand near previous lows in the late 80s and early 90s. Over the same period, annual Amtrak derailments decreased from 80 to 28.

Digging into the details, accidents due to track problems have fallen by two thirds since 2000, while accidents caused by human error have roughly halved over that period. But accidents due to equipment problems -- train cars and engines -- are essentially flat after a brief rise in the mid-2000s. But again, numbers in the late 80s and early 90s were slightly lower.

Taken together, these numbers suggest that Amtrak is making progress on track repair and on better training its operators and putting better safety standards in place. But the equipment failure numbers speak to the state of relative disrepair in Amtrak's rail fleet, which averaged nearly 30 years old in 2012.

We also have good data on passenger injuries and fatalities through 2012. Fatalities are rare, usually in the single digits per year. Fluctuations in those annual numbers are mostly caused by high-profile accidents. With a death toll of at least 6 passengers, the accident last night already makes 2015 the deadliest year for Amtrak passengers since 1999. If we were to chart only fatalities from derailments, last night's accident killed as many people as have been killed by derailments in the past 15 years.

But passenger injuries are becoming more common. An American Enterprise Institute analysis earlier this year noted that rail injury rates in the U.S. are considerably higher than in Europe: "Adjusted for passenger miles traveled, Amtrak’s passengers get injured 58 times as often as those on French railroads," writes Kevin A. Hassett.

The FRA data does show an increase in injuries related to highway-rail accidents, like the one outside New York City earlier this year. Another possible explanation: with ridership rising and trains running at fuller capacity, the average train accident can be expected to result in more passenger injuries.

Again, it's important to note that this set of figures from the FRA includes all injuries that befall a passenger on a train. They don't necessarily all involve accidents. Some could be due to things like heart attacks, or to a person falling on a train after losing balance.

Through all of this, on-time performance is essentially flat, and generally poor. A Post analysis last year found that only one of Amtrak's 33 major routes consistently met its on-time goals. As of mid-2013, Amtrak trains were running on-time about 70 percent of the time, with many routes experiencing on-time arrivals less than 50 percent of the time. Seemingly endless track work in the Northeast corridor and freight congestion in the midwest were among the chief drivers of these trends.

None of these statistics will be any comfort to the dozens of injured passengers and the families of people who lost their lives in last night's accident. The cause of that crash is not yet known.

Correction: An earlier version of the injury and fatality chart reported those numbers for all passenger rail in the U.S., not just Amtrak.