The real problem with this math is that the cost of the braking system would be borne by the company, but the costs of the derailment are borne by the public. So even if the derailment cost >>> the brake system cost, it's an easy decision for the industry to make. That whole privatized profits / socialized losses issue that keeps showing up.
Insurance companies doing this to help people manage risk and are often attempting to help people in moments of grief and tragedy, and those people opted into the contract.
Train companies doing this to unsuspecting towns are stochastic monsters killing people because the victims are a financial externality and therefore cheaper dead than alive. They knew that a disaster could happen but chose good balance sheets over externalized risk.
Boiling this down to pure economics is monstrous; Flip this around. What if I get to decide if you live or die based on my spreadsheets?
Clearly the dollar value of thing isn't the only thing that matters. We should make these as safe as we can afford to, to the point that mass death or even mass destruction doesn't happen while billionaires are made from it. We can't afford infinite safety but while we can afford more safety we should. It is even correct from a macroeconomic standpoint, people who don't die or suffer from disasters go on to be more productive in the economy than dead people.
See any major class action lawsuit, the true cost of these disasters is never paid. The company will restructure, file for bankruptcy, any pay out pennies to the victims.
Norfolk southern gave the town $25k to the town, however the true cost of one resident getting cancer is potentially millions of dollars. The true cost of a single evacuation is probably in the millions also. Nobody will ever pay for this.
I think it's understood that sometimes we need to reflect the value of a human life in monetary terms, but to act as if human lives provide no value beyond actuarial valuations is pretty horrific
cost is cost. You can put a financial figure on lives, health, peace of mind etc. Insurance companies do this every time they insure something.
So the question really is whether the cost of safety will outweigh the economic loss of implementing that safety.