It Depends
Hills have a huge effect because you lose more on the climb than you get back on the descent.
As an example, making a few simplifying assumptions, 30 kmh over a course with an average 2% grade (equal up and down) requires the same constant power output as about 35 kmh over dead flat course.
To make a 30 kmh average on a course averaging 5% is equivalent to 44 kmh on the flat. That one's a bit unreal because very few of us would pedal at full power on a 5% descending grade, partially because doing so gives you a very small net gain.
If you change the model and say that coasting the downhills allows you 20% more power output on the uphills, 30 kmh over a course with a 5% average grade is still the equivalent of over 40 kmh on the dead flat course.