motor yes, battery no.

Think of the riders themselves as incredibly efficient batteries and motors - they can also recharge at 120g carb/hour. The motor itself is just deadweight over most of this process.

But the weight doesn't matter most of the time - on flat sections and downhill, which are 90% of the distance covered, it's completely irrelevant.

For much of the stages, the top guys are not doing much work, they spare their legs for the climbs. They will hide in the pack, doing only very light work drafting. If you could put a smallish battery able to recharge on flat / downhill sections and only provides a boost on the critical uphill parts, that would be a massive advantage.

A lot hinges on this magical contraption that can both accept connection and command, deliver power in sufficient amount when needed while being integrated into the hub, light enough to hide in a bike and somehow even be able to recharge. Have you seen the ebikes that they sell and the hubs that they have?

Now it could definitely work if you only care about a single attack - not even a full climb, but maybe 200-300m where you want to distance your rivals, but the risk (not just of discovery, but of malfunction, etc) just doesn't seem to be worth it. There's domestiques for a reason.