These are just one segment in an ultra-cycling event, and you're looking at which route the record-making cyclists took, correct? I'd assume that they chose the optimal route for total time given a particular store of watt-hours available.
At first glance I'd say it boils down to lifting their weight an extra 1230 feet over the duration vs an extra 8 miles. Which would take more energy in the same time frame? I'd have to put numbers to it, having no practical experience with those distances and speeds, but an educated wild guess is they're pretty close either way. That's including the big climbs which account for the extra elevation gain.
The second part of your observation is bigger than you'd think though, rolling vs more flat that is. You cannot gain back the time spent climbing by descending faster even on easier rolling hills, without putting out extra power. Going by what you say here, that probably tips the balance to the shorter generally flatter route.