What's happening is that you exchange forward momentum for angular momentum. When the track straightens out again, you trade the angular momentum for forward momentum again. The train pays for this in friction losses; the orbital maneuver costs some fuel for steering.