Hydrogen is an energy storage system
Gasoline is an energy storage system
Lithium Ion battery is an energy storage system
A plug-in electric car with Lithium batteries, or an ultracapacitor, or whatever has the same objection as a Hydrogen fueled car -- the electricity has to be generated.
The gasoline powered car uses energy that was captured millions of years ago.
What's more key to the question is what happens when the energy is released from the storage system to power an individual car. The Gasoline (diesel, natural gas, etc) powered car emits CO, CO2, and a bunch of other byproducts of combustion.
The Hydrogen car emits H2O and some miscellaneous byproducts of high temperature catalysis using air.
The battery powered car emits nothing - but generates a thousand pounds of battery waste when the batteries need replacing.
While a power plant that generates electricity from oil or coal generates CO2 and other gases, because of the economies of scale, it can be orders of magnitude more efficient (and less polluting) than a small army of internal combustion engines generating the same amount of power. It's much easier and costs fewer resources to fit a power plant with pollution reducing technology than to fit 1,000,000 cars.
A coal fired powerplant generates on average 2 Lb of CO2 per Kilowatt-hour (the
US average in 2000 for all types of powerplants is about 1.3 Lb/kWh)
An electric car
consumes about 0.22 kWh/mi, which generated about .29 Lb./mi of CO2 back at the powerplant. Charging batteries and cracking water for H2 can be done with off-peak 'waste' electrical capacity.
A typical gasoline car at 30 MPG generates 223 g/km or .79 Lb/mi of CO2 - But those are highway miles on a relatively fuel efficient car. The battery or hydrogen electric consumes little or no power at idle, or in slow city traffic. The gasoline car still puts out significant amounts of CO2 at idle (zero MPG).
So an electric or hydrogen car generates roughly 1/3 the carbon of a gasoline powered car -- and that's without considering the carbon footprint of oil extraction, refining, and distribution -- which approximately doubles the carbon load. (you can't cost electricity with power plant emissions and not cost gasoline with refinery and oilfield emissions)
What we're really looking for is a low-emission production of energy, with very efficient transmission and storage, which can be deployed to cars (and other things) safely and conveniently, for power generation on demand, with little or no emissions in use.
Gasoline is popular because it is an energy dense storage, and the distribution system is so well established. IF the battery problem (deployment storage) can be solved, electric has a lot going for it, including distribution to about 99% of homes already in place. Hydrogen is a possible, IF the distribution and storage can be done effectively, and IF the energy density of hydrogen and the fuel cell is better than the density of batteries.