It is worth noting that, as you said, there are two components to hydrogen production. Water (getting more expensive and rarer every day) and electricity (now where is
that coming from? (other than the wall I mean)).
I suspect that in an analysis of the two power cycles, electricity-to-battery-to-wheels and water-and-electricity-to-hydrogen-to-fuel or fuel cell-to-wheels the battery cycle will prove more efficient. Of course you have to factor in the environmental impact of battery manufacturing and disposal.