A lot of electricity is made by burning coal.
Or destroying river ecosystems by building dams. In my country, there's a devastation of small mountain rivers by private "eco-friendly" power plants.
Solar and wind energy? Both take A LOT of space per KW produced.
Nuclear power, for all I know, is the cleanest of all - as long as all the safety measures are taken and the spent fuel is safely stored.
Very counter-intuitive. But still true.
Now we come to the vehicles. Sure, a battery run one will not pollute directly the city it is driven in. However, adopting many e-cars/bikes will require even more electricity.
Also - batteries. Even when they are recycled, there's a lot of pollution that comes with making them.
Another aspect is how much pollution building a car makes. Any car. Modern trend, that is favoured by capitalism, is getting a new, more eco-friendly car, at least once in 5 years. But this results with more waste made by making more cars. I still think that buying one Golf 2 diesel every 30 years, driving it only when really necessary (say 2000 km per year), is more eco-friendly than getting a new e-car every 5 years and going everywhere using the car.
The really eco-friendly option would be: banning privately owned cars and offering good public transport. And, of course, fewer humans - there's more and more of us each year. As well as more people "packed" in cities, globally, with villages being less and less populated.