Side-by-side is preferred due to the width between the angle iron support members welded to the A-frame for holding the garden variety 12V deep-cycle battery. In other words, you may be able to insert a battery box between the two angle iron supports, so side-by-side is preferred. Otherwise, as Seann indicated, any way you can get them to fit will be fine.
Have you given any thought to a battery box? You'll need something different than your current battery holder. See here for just one example of a battery box that holds two 6V batteries -- http://www.allbatterysalesandservice...cfm/4,576.html
For your convenience, I have attached some pics of my battery box comprising two 6V batteries.
If this is of any interest, I use an appropriately weight-sized nylon rope to insert and remove the batteries.
Finally, give some consideration to whether the new battery weight (on the A-frame) has any affect on your towing set-up.
2004 Suburban 2500 LT 8.1L/4.10/4x4
Putnam XDR Class V, Equalizer 1400#
2006 Jayco Eagle 264BHS
Iota DLS-55, Progressive Industries EMS-HW30C, Trimetric TM-2025