It's not irrelevant. The high water mark for Li-Ion efficiency is 0.875 MJ/kg[1] (in practice e.g. a Tesla seems to be 0.7 MJ/kg). For petrol that's 46.4.
Now, let's adjust that for the efficiency of the power train. Let's give the electric car 100% (in practice it's 95-97%). Production ICE engines are around 20%. That gives us 46.4 x 0.20 = 9.28 MJ/kg.
That's a 10.6x difference in favor of petrol if we take the optimistic 0.875 number. The most fuel-efficient cars sold today consume around 5L/100km. A liter of petrol is 0.78 kg. A 1000 km of range is the probably holy grail for an electric car.
A a car powered by petrol needs to carry 39 kg of fuel at the start of a trip for that range. That'll be at best ~390 kg for the Tesla at its theoretical limits, which isn't counting overhead weight associated with the battery pack, and unlike a petrol-powered car the weight doesn't reduce as you go through the trip (a significant hurdle for e.g. electrically powered airplanes).
Of course the power train of an electric car is lighter than on the ICE-power vehicle, but the ICE still wins, and all of this is before we get to the battery needing much more volume than petrol, although as the Tesla shows you can win back some space by placing it in the floor, which isn't a realistic option for ICE.
None of this means electric cars aren't viable, but the weight and volume differences for the same MJ are inherent, and aren't going to go away.
1. https://en.wikipedia.org/wiki/Energy_density