The specific energy of gasoline does not matter unless put into context with the efficiency of the mechanism extracting it into useful work.
The mechanism in this case is an internal combustion engine and its efficiency is around 10%.
The mechanism for extracting useful work from a battery is an electric motor, and it achieves ~98% efficiency.
Which means gas is only ~4X more dense in terms of actual useful energy. So a battery pack weighing 4x more than full gas tank to get the same range is not unreasonable at all and is basically what a Tesla is.