Germany’s worst industrial scandal in recent memory arrived when auto companies fiddled with emissions tests to make diesel cars seem greener than they are. Now a new study suggests that electric cars touted as a diesel alternative also aren’t so great for the environment.

A study this month by the IFO think tank in Munich found that a popular electric car releases more carbon dioxide into the atmosphere than a comparable diesel engine. The authors compared CO2 output for a Tesla Model 3 and a Mercedes C220d sedan. They calculated...