If you are adding H2 gas from some other outside source it is not a question for the First Law of Thermodynamics. Thats what fuel cells and hydrogen cars do. But to take into consideration the impact those systems have, you must account for how the H2 came to be there.
Again, not the same as this "water" system where the energy used to make the Hydrogen gas comes from the gas combustion. That gas combustion then creates (through the alternator) electricity that splits the water molecules. That energy does not result in a 100% transfer, indeed no engine has ever resulted in a 100% transfer. So energy is lost in the process of splitting the H2, and again in the combustion of the H2. One can remove a wasteful step and simply use the excess energy from the alternator to help power the car. That is, in essence, what the H2 is doing, but by eliminating the middle step. This is how the gas/electric hybrids work on a smaller, less efficient, scale.
There is no free energy in life, ever. This is not an exception.