If the power is generated by burning coal and after transmission efficiency losses etc, gasoline cars could actually be better for the environment.
If I could buy a type of vehicle that was only 10% thermally efficient but the fuel was practically free, that would be pretty cost effective even if not thermally efficient.
Once EV manufacturing is decarbonised (which is I assume ongoing) this will be moot too.