The question here for the H2O example is about the efficiency of cracking it verses the energy recovered from the use of the O2 and H2 as fuel sources.So you can' t use water as a fuel to make... water. You would require at least the same energy to electrolyze water into gases as you could hope to get by combining the gases.
My fundamental point being, that you can store H2 "inside" something else.
Getting it out is another discussion.
Every once and a while some guy comes along claiming to have the self running electroysis machine that cracks water and burns the gasses to run a turbine generator that makes power to crack the water...
And for the record, that "getting it" discussion is the one the Greens tend to avoid as the resource expenditure costs to be green tends to overwhelm any benefit.