Designing the hills of a roller coaster so that even an empty cart makes it to the end is a genuine engineering challenge, and it's far from simple.
Planners have to estimate friction carefully, taking into account the curves and how forces change at different points along the track. On top of that, friction can shift as the equipment ages, which complicates the math even further.
A classic real-world solution came from Luna Park in Melbourne, where a brakeman rode on the back of the cars. The cars were built to run slightly too fast, and the brakeman would slow them where needed. That built-in margin of error let the ride cope with wind, rain, ice, or heat, conditions that simply can't be fully predicted at the design stage.
At the end of the ride, there's always some surplus speed, and brakes are applied to stop the cars at exactly the right point. It would be impossible to tune the hills perfectly for every weather condition, so having an adjustment process somewhere along the way is essential. If you know the rolling resistance of the cars, you can calculate the minimum hill height required, but in practice you always build it a little higher, and that extra margin comes from experience.