As you have asked, the numbers favor electic over gasoline. But this is misleading. Electric power, for the most part comes from coal, fuel oil, hydroelectric and other sources.
Conversion of coal, fuel oil, hydroelectric and other sources to charge electric car batteries involves significant energy loss.
There are losses in conversion to electricity. There are power transmission losses. There are losses in converting the voltage of the power mains to the voltage required to charge the batteries. There are incured charging losses in the batteries; the batteries takes more energy to charge the batteries then they acquire.
And in the end, the bottom line is not BTU comparison but cost.