They absolutely can optimize the engines for certain speeds. Here are how the tests work:

Two separate fuel economy tests simulate city driving and highway driving: the city driving program consists of starting with a cold engine and making 23 stops over a period of 31 minutes for an average speed of 20 mph (32 km/h) and with a top speed of 56 mph (90 km/h); the highway program uses a warmed-up engine and makes no stops, averaging 48 mph (77 km/h) with a top speed of 60 mph (97 km/h) over a 10 mile (16 km) distance. The measurements are then adjusted downward by 10% (city) and 22% (highway) to more accurately reflect real-world results.

It's fairly easy to lean out the engine and design it for the upper 40 / low 50s mph range.