You may be easier putting them in a bottle and sticking that in a bottle cage.
I am slightly confused by your measurements! how are the batteries arranged? I am also presuming the battery measurement are in mm rather than cm as it would be huge otherwise.
if they are in rows of 3 do the 9 batteries not make a square end?
i have seen packs of 4 cell packs mounted to a stem but not more that that.
With the bottle idea you simply rip the drinking nozzle bit out and feed the connector through then re-pack the nozzle with blu-tack or silicone sealant depending on how permanent you want it.