It is because the mechanical energy of the roller coaster is conserved.
In a closed system, no energy and matter can pass through the system boundary. The energy in a closed system cannot change.
Within a closed system, energy can be exchanged or transformed, but the total energy remains constant.
At first glance, a roller coaster is something like a passenger train. It consists of a series of connected cars that move on tracks.
But unlike a passenger train, a roller coaster has no engine or power source of its own. Here's how roller coasters work shared by Howstuffworks.com.