From across the globe, we hear about train derailments almost on a daily basis.
Today’s invention attempts to lessen the severity of such incidents.
Each carriage would have some wheels at each end fitted with sensors which could detect when a wheel had lost contact with the track (a magnetic field sensor mounted in a radial recess on the rim would be sufficient).
When that happened, the coupling to carriages ahead and behind the derailing car would instantly break (perhaps even pushing away as they did so). All brakes would be automatically applied at the same time.
This would result in only one carriage leaving the track -without dragging several others with it.