You have to be especially careful when comparing oil/gasoline vs solar/electric through. Oil has an especially well developed infrastructure for it being drilled, refined, delivered and stored. Electricity on the scale to power all transportation does not, so there are large short-term costs.
In terms of effeciency, you don't replace a billion BTU's of oil with the same amount of electricity, what you want is locomation. Only about 25% of oil's energy ends up spinning the wheels, compared to 85% of energy using an electric powertrain.
In rich countries the electrical grid only needs to roughly double to power all transportation. The US did that in the 01960s, and China did it in the 02010s and probably will have done it again this decade.
This is why I genuinely suggest PV cells mounted into the bodywork of EVs. They'll "only" add 10-20 miles per (good weather) day depending on the specifics, but this is a significant fraction of the (mean) miles driven per day per vehicle, which means the necessary grid upgrades are much smaller.
Almost all those cars still need to be charged, the weather won't always be good, people don't generally choose to leave their cars parked in direct sun if they can help it, etc. — but as a systematic reduction in impact over the entire power grid, it's non-trivial.
In terms of effeciency, you don't replace a billion BTU's of oil with the same amount of electricity, what you want is locomation. Only about 25% of oil's energy ends up spinning the wheels, compared to 85% of energy using an electric powertrain.