In railroad use, guard rails or check rails are placed parallel to regular running rail along areas of restrictive clearance, such as a bridge, trestle, or tunnel. These have the effect of keeping the wheels of in alignment in case of derailment. It also helps to minimize damage to the structure and allow easier post-accident cleanup.
Although there has always been some form of guard rails as long as there have been trains, the precursor of the guard rails we have today were invented in Laconia, New Hampshire by Gorham B. Ames in 1894.
On sharp curves, guard rails may be placed inside the inner rail, where they engage the back of the flange of the wheel on that side.