Yes. If they learned how to do it.
Functionally, they had all the tools needed. Except for the knowledge of how to do it.
Electrolysis is easy, all you need is an voltage source (a battery works fine), some conductors, and the electrodes.
Of course, this presupposes that you have the concept of electricity. And know how to build a battery. And the concept that materials can be composed out of other materials, and that the correct process can be used to split and recombine them.
In effect, you need to somehow learn the basic concepts of chemistry and electricity and the nature of the states of matter (solid, liquid, gas). Not much depth of knowledge in any of these fields, but the fundamental concepts are needed. In Earth history, those knowledge and concepts only got together towards 1800, when Alessandro Volta build his first working batteries, and developed electrolysis at the same time. Although it was several years before he really understood why it worked, his initial theories were a bit off.
So, that's quite a lot of knowledge required. But in terms of tools, infrastructure and materials? No problem at all. The needed materials were available in old Egypt already. As soon as a culture could make vinegar, smelt iron, and make copper wires.(zinc helps, a lot, but is optional)
Frankly, its amazing that none of the experimenting alchemists through history have stumbled across the concept of batteries, and once you have batteries then electrolysis follows naturally, and that provides an excellent insight into the nature of gases, and eventually true chemistry. Possibly because most natural battery cells have a very weak voltage from one cell (typically under 1.8v), and need the cells connected in series to make enough voltage for a visible spark?