My question would be, short of some disaster happening to the tracks with too little notice to do something about it, why would trains ever have to derail? At all?
With some kind of competent computer modeling of the train and the tracks and their terrain, it should be possible to govern the train’s speed to keep it upon the rails. Maybe this is 19th century technology but we can keep up with it using 21st century technology.
65
I believe that the 19th century 54 1/2 inch track spacing they still use is a serious drawback to stability.