It actually takes more energy to produce the hydrogen than the hydrogen produced can provide and most of the water destroyed will never be replaced, ever
maybe Elon Musk can go find a chunk of ice on mars and tow it home
Hydrogen just loves to give up energy by oxidation. You have the problem backwards: It takes a lot of energy to crack water into oxygen and hydrogen.
And yes, it's a stupid idea for several reasons. "Losing water" isn't one of them.