It's called a 'Check Rail'. Usually you can see these on the inner side of curves. If a train derails on a curve, it will tend to move over the outer rail ( The wheel will climb over the outer edge of the curve). In that case, the inner wheel will touch this check rail and stop further outward movement. You can see these kinds of rails at points and switches also, where trains switch tracks.