No I would not do that.
I'd use deep cycle batteries in standard case sizes, as are used on mobile homes and boats. These are quite capable of handling significant tilt without spilling. (It corresponds to the side-forces they receive in a turn. Tangent of coefficient of friction.)
Then I'd put them in the sturdy, flexible, plastic cases used to protect them from weather (and their surroundings from them) while mounted in places like out on the hitch assembly at the front of a travel trailer. (This will also help keep salt spray out of the vents and off the terminals - a good idea if you don't like corrosion and chlorine gas.)
Then I'd find a place, or a pair of places, low in the boat and positioned to not affect (or to improve) the trim - up against a bulkhead (like the side of the V-berth). And I'd provide a very sturdy mount for the strap kit that came with the box, and use that to fasten them securely in position - so they won't slide around as the boat heels. And I'd use heavy cables fastened solidly as well, as a backup system to limit the battery's travel (and keep it upright) if the strap lets go. (Letting that weight move is like having an equivalent amount of flooding - it kills your static stability by shifting to the low side and encouraging further roll.)
This is EXACTLY what the designers of sailboats do.
Example: Hake Yachts. Battery in our Seaward 23 is in such a plastic box fastened under the portside settee, against its inner side, near centerline both fore-aft and port-starboard. The slight bias toward bow and port is partially compensated for (depending on fill state) by the removable 3-gallon diesel fuel tank (for the inboard auxiliary) at the starboard rear corner of the cockpit.
The Catalina 22 we had previously (with an outboard auxiliary) did the same thing in a different location for the "house battery" powering the lights and radio.