We know that the mechanical energy is conserved, that is:
Which means that when the car is riding down the potential energy is being converted to kinetic energy; conversely, when the car is riding up the kinetic energy is being converted to potential energy.
Now, the first hill has to be the tallest so that at that point the car has the greater potential energy and for conservation of energy we make sure that the car can climb up all the remaining hills on the roller coaster without getting stopped and without having the need of making more work on the roller coaster.