The problem is more like that cars that use fossil fuels have a very much lower efficiency rate than electric cars. So theoretical if you use the same amount of FF for the energy production and use that for electric cars it would be more efficient.
But that shouldnt be the solution.
In countries that generate almost all of their electricity from renewables, they are better tbh. Although more environmentally damaging to produce.
The problem is more like that cars that use fossil fuels have a very much lower efficiency rate than electric cars. So theoretical if you use the same amount of FF for the energy production and use that for electric cars it would be more efficient. But that shouldnt be the solution.