The engines going up or down is on thing, especially on straight track. Add curves into the formula and it gets trickier.
You also need to consider how many cars you are going to pull & their weight. If you do it right no problem, done wrong and the consist derails like a jack knife, believe me I know.
The best I ever did was the Tehachapi over/ under 3% over100" radius 40' long , 14" tall at the bridge, 1 engine pulling over 30 boxcars, nice slow and steady.
Heaviest cars up by engine lighter cars at rear. Be careful of a to heavy caboose behind lightweight cars.