I too had the battey comp. door open and the battery hung out on the cables, fortunately the door was saved by the door cables.
I took a piece or angle aluminum and cut it a bit longer than the opening and pop riveted it to the frame and the door hinge to it. I also repaired the floor area of the opening. (ROT) I then coated the floor with water proofing (roofing compound)
I bought a new lock (locally) and checked for fitting to allow for trailer body flexing so it would not open . I then made a piece of that same angle aluminum to fit inside the compartment so that if the door opened the angle aliminum would block ther battery fro coming.
Not the battey can move from side to side when travelling and that is why the door is pushed out.
If you would like a pix of my fix please E-Mail me