You can measure that long tailpipe.
Include the energy used to make the battery. Mining and smelting aren’t clean, so also include the emissions.
You still end up with a vehicle that is more efficient and pollutes less than a comparable gasoline vehicle.
There is also an advantage to ending your tailpipe at the power plant. The power plant has a multi million dollar emission control system with continuous monitoring by a team of engineers. Your car does not. The power plant creates a lot less pollution per Joule than your car.
One must also factor in the growing proportion of electricity that is produced by renewables
California ISO - Supply, Today's Outlook
View real-time and historical data on generation resources, including renewables, currently on the system.
www.caiso.com
A lot of small engines scattered across the landscape burning hydrocarbons to make energy is about the least efficient method imaginable.