That is one way of looking at it - but the problem with looking at it that way is that an electron is not equivalent to energy. The available energy is from moving an electron to and from different energy levels - energy is measured in electron-volts not electrons. The same way that available hydroelectric energy is a function of both the quantity and head of the water.
What this means in the case of Brown's gas is that the voltage needed to disassociate the water multiplied by the number of electrons moved from one energy level to another is considerably more than the energy content of the gas produced and able to be converted to heat by burning. What happened to the 'missing' energy? It is converted to heat in the electrolysis cell. And this analysis ignores losses from flow of the gas, pumping water etc, which are probably small in comparison.
A similar energy loss is involved in the charge/discharge of, for example, a lead acid battery (similar results apply to any battery, but most of us are more familiar with lead acid). Again, number of electrons in is equal to the number of electrons out - but consider: we charge at, for example, 13.8V, and discharge at, for example, 12.5V, automatically meaning that the energy efficiency of the system is only 90%, without even looking at anything else.
John