Busted! You’re quite correct, the average speed will indeed be faster down/up the hill than on the flat in the airless, frictionless thought experiment of mine. I take my trousers down to your impeccable reasoning here. I wasn’t talking about a brachistochrone curve though, just two linear slopes of equal angle.
This means that us cyclists are being doubly cheated by hills 
The cycling analogy wrt windspeed is not the same as a boat on flowing water or a plane in an airstream though - the latter two have velocities that are indeed additive, but it’s more complex with a land vehicle cutting through air. However, if the bike was on a moving walkway in a vacuum…
Just pointing out a couple other facts about cycling:
First, the headwind/tailwind math is not quite accurate for bicycles, as air resistance is a big part of the drag. Air resistance goes up as the square of your speed, so going fast for a bit then slow for a bit actually ends up making more total drag than having a constant speed. So the hills leave you with more overall air resistance and therefore slower for the same energy expended.
And secondly, your leg muscles are most efficient when they’re not putting out too much force (why the first part of learning to cycle race is learning to pedal more quickly in an easier gear). So just because of the physiology, pushing yourself up a hill and then resting a bit coming down will probably tire your legs far more than a constant pace on the flat.
Don’t forget the treadmill.