Should one pedal over a mild slope? I do a bit of cycling these days, as in nearly 50 km a day.

I do a ring-route. And, there is a mild slope, safe enough to sprint on, and roughly 2 km long with at a worst-case 400 m line of sight visibility without any turn.

By the time I get there, I am a bit tired as I have to climb an ascent to get there.

Should I keep pedaling on such a slope or just sit, steer, control the cycle and then use the momentum in the later part to go another mile or two without much exertion, or should I pedal on the slope so that I can carry on with that momentum over a longer distance.

P.S.: Usually I am not too tired to keep pedaling there. So, I can continue to pedal.
Because wind resistance is proportional to velocity squared it takes more power to go from 30 to 32 than from 15 to 17.  So you get more bang from your pedal power at lower speeds.   If it is a relatively short downhill and you have considerable speed you are typically better off coasting and then pedal when you get to a flat or flatter section.

So you are better off exerting yourself on the lower speed ascent.  Then recover on the downhill.  It might be 2 minute recovery or 20 minute recovery.  If you notice racers typically go all out on the ascent.

If you went up the hill at 8 mph and down the hill at 13 mph compared to a constant 10 mph you would have about 5% more wind resistance.