Derail

A derail or derailer is a device used to prevent fouling (blocking or compromising) of a rail track (or collision with anything present on the track, such as a person, or a train) by unauthorized movements of trains or unattended rolling stock.

The most common form is a wedge-shaped piece of steel which fits over the top of the rail.

[7] If a car or locomotive attempts to roll over it, the wheel flange is lifted over the rail to the outside, derailing it.

[8] It can be manually or remotely operated; in the former case it will have a lock applied to prevent it from being moved by unauthorized personnel.

[7] These are basically a complete or partial railroad switch which directs the errant rolling stock away from the main line.

Hinged derail with automatic blue flag
A derailed train car at a closed siding
A derail device installed on a siding at Glen Haven, Wisconsin , oriented to protect track located off the bottom of the picture
Derail on Nemuro Main Line , JR Hokkaido . It is set so that a train proceeding away from the camera will remain on the track.
Split rail type derail on the A&M in Rogers, Arkansas
Powered derailer, Temple Mills, Eurostar Maintenance Depot, UK