The train probably should have had some measures in place to prevent that from happening, and definitely should have had some means for putting out fires once they start, but the engineer on this day had just one instruction for the crew: "Jump for your lives!" Everyone obeyed except for the brakeman, who realized that letting the train roll into a population center and explode wasn't the ideal solution to this particular trolley problem.
So the brakeman stayed aboard. He threw open the throttle to get the locomotive moving as fast and as far as possible. When the fire reached the powder and the train blew up, he wasn't totally out in the wilderness, and the ensuing destruction of some barracks did kill a dozen or so laborers. But the explosion, which was big enough to shatter every window in town, was far enough away that he'd saved hundreds of lives. Then again, of course this guy was ready to lay his life down to save others. His name was Jesus Garcia. Jesus. (Pronounced differently, but still.)