(While I'm not arguing that motor doping was widespread) I don't think that's how it would be used.
Firstly, in 2025 (let alone a decade ago) LiPo batteries are pretty heavy for a meaningful amount of power. Even if you could hide them in a frame, there would be a disadvantage to pulling a lot of weight around for hours. (Try riding a ebike with the engine turned off.) It's therefore most likely that their power capacity would be relatively small - a lot less than today's consumer ebikes.
Secondly, a top pro rider can output an average of ~350-380 watts for 4-6 hours. [0] The limited capacity of a small battery is likely dwarfed in comparison. It's therefore most likely that (per the Cancellara example) they'd keep the battery power for a limited number of short attacks at a crucial moment which might help them drop an opponent and then allow them to ride clear for a win.
If this logic is correct, then the impact on overall times would be negligible as they're not using it for a significant proportion of a race, but the impact on a rider's liklihood to win might make it worthwhile.
[0] https://www.cyclistshub.com/mathieu-van-der-poel-statistics/
For classics maybe, but for TdF, a “crucial attack” isn't going to do much if you aren't able to ride faster than your opponents in average on the whole climb, and doing that is going to have an impact of the timings (each “col” has its own record table).
Drafting’s a factor on many climbs at the crazy speeds they achieve, and it can be enough of a benefit for a slightly slower rider to keep up with a slightly faster one. That’s why it’s rare that people ride away from others on a climb without an attack to break the draft.
A few hundred extra watts for a few seconds could be the difference between a failed attack and a stellar attack, then allowing the attacking rider to ride away.
(Of course, the weight of the batteries and motor would have to be considered as it would slightly impair the climbing performance.)
You're forgetting all the unsuccessful attacks where the attacker is simply swallowed back by a faster pace of the racers left behind by the attack.
I can see situation advantage for a very strong, title contending, competitor, but honestly that sounds too niche to be really useful.
Also:
> That’s why it’s rare that people ride away from others on a climb without an attack to break the draft.
Did you watch Tour de France the past few years? Even without attacking, Pogacar was simply too fast to follow in the mountains for everyone but Vingegaard, so there's only one guy who could have gained something and it's two times champion Vingegaard. Talk about a niche.
Pog's a special case. :)
I'm thinking more of a breakaway situation - a group of roughly equivalent riders, all knackered after a hard day in the breakaway, all vying for the stage win. If someone gets a gap, 90% of the time 'group two mentality' takes over and they don't organise a successful chase. Giving one of those riders an extra boost of watts for a few seconds for that attack could make all of the difference.
You're right that it won't always work, but these things are a numbers game - most of the time, breakaways are swallowed up, and even when a breakaway rider wins, (obvs) the rest of them don't win. And yet people still join the breakaway, to try to realise that tiny% chance of winning. Going from 5% to 10% win probability isn't much overall, but it's still doubling your chance.