This question combines the principles of energy conservation and circular motion. The insight is to realise the condition for which the rail-cart will fall off of the track - when there is no contact force between the cart and track at the apex of the loop.Energy of cart at top of track: mgh Energy of cart at apex of loop: mg(2r) + 0.5mv2Hence energy conservation implies that mgh = mg(2r)Newton's Second Law at apex of the loop: Fcentripetal = mv2/r = mg - FcontactSetting Fcontact = 0 and substituting v2 = g into energy conservation equation gives h = 2.5r