Inertia is the force that presses your body to the outside of the loop as the train spins around. Although gravity is pulling you toward the earth, at the very top the acceleration force is stronger than gravity and is pulling upwards, thus counteracting gravity.