You should begin by evaluating the amount. Because, if the electricity source is a 4.5V battery, the hydrogen amount evolved over hours will never attain the explosive concentration in a room.
To burn evolved hydrogen, I'd trust a catalyst (Pd) better than a lighter. If the flame gets out, the catalyst reignites the hydrogen. Better, a (controlled!) proportion of air mixed with the hydrogen still burns the hydrogen while the "flame" temperature can remain below the autoignition of hydrogen in air, which is like 500°C. But the setup is more difficult and expensive.