Answer :
When the car is moving the cup and water is moving at the same speed. When the brakes are used the car slows down but the cup and drink are still at the speed the car was before it started slowing down so the water and cups inertia was greater than the car so it spilled out.