To extract hydrogen from water uses electrolysis. To extract it, you use less energy than you get out from burning oxygen and hydrogen back together again, so why don't we use some of the kinetic energy made by the engine to recharge the battery to keep the process continuous. Also, you wouldn't need to refill it, because its reactants are hydrogen and oxygen (water), and in the end, you get water as a product, so its renewable. Even if the kinetic idea doesn't work, you could use small solar panels to get the energy you need for the electrolysis.
If I am wrong please tell my why and how i can correct myself.