As weight was a problem from the beginning (launch) of an Apollo mission, was the LM water tank already filled, or were they filled during the trip to the moon from fuel-cell byproduct water?
In the Command Module, water was generated by fuel cell operation; in the Lunar Module, all water supplies were loaded in storage tanks before lift-off.
The LEM did not have fuel cells, it was battery powered only.
If you were asking about product water from the Command Module fuel cells, there was no interface from the CM->LM to transfer that water. Notice in the water schematic below that the tank fill ports (below each tank) are all labeled "GSE" - Ground Support Equipment. And, the check valves in the tank outlet lines prevent any water from flowing into the tanks.
All water was, therefore, stored on board prelaunch and not generated. (With the exception of condensed water from the Atmospheric Revitalization System water separators, which entered the system at the middle bottom, and was used for cooling only).
The GSE device used to fill the tanks is described in the 1965 Apollo LEM Familiarization Manual LM790-1. (Which I am not finding on the internet right now, except for sale on Amazon...)
5-62. WATER SUPPLY UNIT, PART NO. 430-94119. The Water Supply Unit is a mobile unit that contains a pump, a reservoir, starters, tubing, valving and controls, remote and manual controls, explosion-proofing and instrumentation. It is used in the LEM Environmental Control Subsystem to fill the water management section with triple-distilled water. This unit is an item of common usage GSE modified for LEM use.
Diagrams from the LM Orientation, Course No. 30005-012, April 12, 1966