I have a pair of Lifeline AGM batteries mounted on a shelf (factory design) under the deck. No issues.
If I do get water in the bilge, it is underneath of that shelf, so water never gets to those batteries.
Also... I have primary and backup 1500 gph pumps to make
certain water never gets that high.
Now when I installed those batteries it was a bit of a pain due to the size of the batteries and the location under deck.
My eventual plan is to remove that leaky OEM bilge deck hatch and replace it with a 24x24 aluminum 'NASA hatch' like Bobby used on his 2530.
https://shop.hamiltonmarine.com/product ... 15300.html
The 24x24 hatch will 'uncover' the batteries making it easier to get to them, as well as giving me a water tight seal.
A win - win proposition, though if you check that link above, you will see that those hatch are not cheap.
So... you can mount your batteries under deck so long as precautions are taken.
Hope this helps.