The thing about electric machines, is that it opens the door to efficiency. If you can shrink the systems and only run what is needed, when needed, total energy consumption will be reduced.
I bet if you actually measured energy requirements of an average shovel or equipment, the energy usage isn't as technically efficient as it could be. Electric opens up the door to running multiple parallel systems. So that if all you're doing is swinging, only that circuit is active.Engines are sized to run multiple functions at once, hence technically oversized if only a single function is being used.
An excavator, and a lot of heavy equipment, is a perfect example where mass isn't a bad thing, it's beneficial. So a massive battery pack could offset counterweight requirements, and could also allow for lowering of C of G.
A lot of careful work will need to be done to isolate the battery packs. A massive complicated battery pack will isn't going to last in a high vibration environment.
All that said, still have the charging issue...Portable nuke power would be kickass, but somehow I don't think that'll ever happen.