Also 40% is a theoretical (lab) value for a non turbocharged diesel engine - in practice most engines are operated out of their optimal range, they are turbocharged (a turbo increases power output at the cost of decreasing compression ratio and thermal efficiency), there are losses in the transmission, hence efficiency is much lower than 40%.
BTW, in lab, a coal plant with a steam turbine can achieve over 50% electric efficiency (some reports say even 60% is possible). They are too expensive to be used on large scale, though.
Also, if you want total efficiency in terms of C02 then you need to consider. Gasoline takes a lot of energy to extract, refine into a usable state, and transfer around the world. On the other hand hydrocarbons extract energy from hydrogen bonds not just carbon bonds so they produce less C02 per BTU.
Net result electric cars backed by coal power still win vs IC, but not by as much as you might think.
PS: You can also use turbines in hybrid car which would boost it's efficiency even more. But, you can also produce very cheap solar power which once again shifts things back to electricity.
What would you say is the typical efficiency of a modern gasoline car? Say, one that uses 7L/100km on average?
Also, why do the coal plants with higher efficiency so expensive? I've read somewhere that higher heat would be better, but the steel that can resist it, is too expensive. Is that correct?
[1] https://forums.tesla.com/forum/forums/charging-efficiency-0
I imagine it will be similar to those before-after photos of cleaning smoker's apartments.