...
For the third category, sometimes you don't even need an actual derailment -- for instance, to allow 'old school' activation of the crossing gate and bell at the dual track crossings on my layout, I used a separate power supply rather than track voltage to activate the crossing features through an insulated outer rail section on each track, relying on the rolling stock wheels on one track or the other to bridge the outer rails and provide a path to the common ground. Both crossings worked flawlessly . . . until trains on both tracks arrived at the same crossing at the same time, in which case the five amp circuit breaker protecting one or the other of the circuits would immediately pop open, every time, stopping that train in its, err, tracks! I still haven't figured out what I did wrong (I suspect there's some back voltage from the two running engines feeding a differential voltage back into the common ground that's at fault, but so far I haven't had the time to run it to, err, ground, and just ended up temporarily disconnecting the second track activation wires). sigh ...