As you may know from my previous questions that I am training for a 150km ride. I want to know if riding on hilly road for 20km is better than riding on a flat road for 40km?
Better? Don’t know. Useful? Yes.
One way you can use the hills to your advantage is to get your heart rate up. A good workout could be 4 minutes riding hard, then 3 minutes recovery, repeated 4-5 times. Riding hard means getting your heart rate up pretty high (171-180 for me) and this happens naturally and more consistently when you’re riding up hill. It’s also straightforward to do on the turbo.
Maybe you can find a route with a few medium size hills that take a few minutes to climb, or ride up and down the same hill.
If you warm up riding gently for 15-20 minutes before and warm down for 15 mins after, for example, then you’re likely to cover around 20km in around one hour.
Of course it is still necessary to do a long ride every week for the training adaptations and to practise nutrition strategy, building up the distance weekly.
Possibly. If your goal is to improve your general fitness and endurance in preparation for the 150km event, any riding is going to help as long as you are pushing yourself enough so that your body is making adaptations.
Riding intervals of intense efforts with rests in between is one way to do that. The great thing about hilly routes is that they force you to do periodic hard work.
If the 150km event is mainly flat, you definitely want to mix in the flat route so you train for longer durations of sustained moderate effort.
I want to know if riding on hilly road for 20km is better than riding on a flat road for 40km?
Neither is "better" in isolation. Depending on how you ride, though, the type of workout can be (and probably will be) completely different between the two rides.
The real question is, what do you need to train for?
First, if you don't push very hard up the hills, and don't rest much on the descents, the longer ride is probably going to be "better" because you'll get more work in - and in this case "better" assumes you want to get more work in. Because there are times when all you want to do is a relatively short, easy ride. Like when you're overtrained, your legs are sore, and you aren't recovering. Or maybe the day after a long, hard ride just to loosen up without putting any stress on your muscles and body.
But if push really HARD up the hills, the workouts will be completely different.
Assuming on the 40km flat ride you don't push yourself as hard as you can for the entire ride but just do a steady, non-stop pace where, for example, you can easily talk to someone, you'll be totally aerobic and a large percent of the energy you burn will actually be fat and not glycogen. And that's good because your body has pretty limited glycogen stores available for use by your muscles - when you run out, it's called "bonking", and it's really bad news if you want to keep riding at that moment.
As you put more and more effort out, your body shifts to using that stored glycogen as energy. Eventually, you start putting out enough energy that your body then shifts to anaerobic metabolism - producing power without using oxygen (well, without using oxygen immediately to produce the power - you're going to need a lot of extra oxygen to help clean up the metabolic waste products anaerobic metabolism generates...)
You can produce a relatively large amount of power for short periods of time via anaerobic metabolism, but it's hugely inefficient compared to aerobic metabolism. Think of hard efforts that are between 15-30 seconds and up to 5-10 minutes and maybe even longer, depending on the specifics of your metabolism and your level of fitness. But those anaerobic efforts build up waste products that you have to spend time recovering from. See oxygen debt.
And for shorter, even harder efforts, your muscle cells will just directly torch the ATP molecules stored in them, leaving you totally spent and loaded with a lot of waste products. On a road bicycle, this would be an all-out sprint at the end of a race.
Why is this important?
Because as you ride differently, you're training different metabolic pathways. Really long steady rides at a lower effort will build your fat-burning capability (this is why professional cyclists ride a lot). And that fat-burning capability is the most efficient way to fuel your riding. (And that's why you can't get really fast over longer distances unless you ride a lot - or have great genes/pharmacists...)
Depending on how hard you push, a steady 40 km ride can be anywhere from almost entirely fat-burning to mostly glycogen burning (think time trial level of effort), but even then it will be mostly if not entirely aerobic.
Once you start adding hills, though, you can easily get into anaerobic efforts - especially given the descents are perfect for recovery. And that will burn almost nothing but glycogen. And remember - you only have so much of that before you're done.
So the two rides - 40 km flat, and 20 km hills, will do completely different things for you. Neither one is "better" without context.
One thing to note, though, is that the impact on your body from training efforts is pretty much proportional to your power output to the fourth power. That means a minute spent putting out 200W is 16 times harder on your body than a minute spent putting out 100W. So you can spend a lot more time riding on flat ground than you can spend pushing hard up hills.
But all that leaves out something else - endurance. Muscular endurance needs to be build up, too. And the only way to do that is ride for long periods.
Ideally, you want to train in a way that matches what your goals are.
Since your goal is to ride 150 km in a few months, unless that 150 km has a lot of hills you need to train for, I'd say you need to put your effort into longer, flatter rides where you try to pedal at a constant, steady, but relatively easier level of effort. Because you need to build a lot of endurance in a short time, and do it without overtraining.
Another viewpoint - I'm a strong rider who can do 40 km/h on the flat.
However the climbs leave me grinding away slowly because I'm also heavy.
So if your long 150km ride is purely flat then you don't need to train for climbs. If there are any climbs where you need to drop to the bigger gears on your cassette then absolutely you need to train on climbs.
Short climbs of a dozen metres elevation rise can be blasted with momentum and effort, but anything over that starts to need pacing and practice to get better times.
Also, climbs implies descents on the other side, and they also need practice in their own way. Ideally in different conditions too - a wet descent needs more consideration than a nice dry one.