Problem 6-44.
When the block is at the highest point of the loop, there are two forces acting on the block: Its own weight (mg), and the normal force (N) from the rail. If there is normal force, the block has to be in contact with the rail. In other words, the normal force of N>0 ensures that the block remains on the track. The block will start to leave the rail when N=0.