Coal releases the most CO2 per unit energy. It's almost pure carbon after all. But to compare with a gasoline car you have to consider:
(1) Large power plants are anywhere from 1.5X to 3X more thermally efficient than a small piston engine. How much better depends on whether the power plant is an old school boiler and turbine or a newer supercritical steam or combined cycle plant.
(2) Gasoline is the highly refined and quality controlled end product of a long supply chain. Oil must be drilled, sometimes cracked (for heavy oil), shipped (often more than once), refined (this uses a lot of power), doped with small amounts of manufactured additives, then shipped at least one and sometimes two or three more times to a gas station. Every step of that supply chain uses even more energy, and this must be subtracted to get the overall end-to-end efficiency of a car engine. This makes car engine efficiency from oil well to tailpipe really suck. Coal meanwhile is often shipped only once or twice and requires minimal processing, usually just pulverization and then flue gas scrubbers at the exhaust end.
(3) ICE cars require a lot more maintenance and fluids that have to be changed, etc., and all that has to also be considered in their energy footprint.
EVs are superior in every single way except range and recharge time: complexity of the vehicle, reliability, acceleration and driving experience, urban pollution, overall emissions, and end to end efficiency. They remain superior even in the worst case of a 100% coal fired power grid, and very few regions get their power from only coal. The range and recharge time gap is already small enough to make EVs practical for 90%+ of driving scenarios and the gap is closing. The oil age is over.