New batteries are a very good idea but, if what you say so far is accurate, then the battery is likely adequate for now. It has little to do with the fridge working on electric as the heater is 120V. not 12V and the 12V (battery) seems to be operating the circuit board as it should for now.
Gas operation:
Ahh... Now we get more interesting story. You stated that you heard the flame light... Perhaps so, if you observed it as it is normally very small and quiet. The little black box you saw contains the control board which likely has a relay on it. The first clicking heard is usually the igniter trying to light the flame. Usually, either the flame will light, or the igniter will try 3 times before giving up and cause the Check light to come on.
If the flame actually lights and then goes out, that is because the control board does not recognize that the flame has really lit. This is done by using a flame detector that sits in the flame and it is the same physical piece as the igniter. The detector works by generating a VERY small voltage back to the control board when it is heated by the flame and thus a poor connection will undoubtedly cause a failure and the Check light will come on.
Verify that the igniter/detector is sitting directly in the flame and then check the other end of the connecting wire making sure the connection at the board end is clean, not corroded and is tight. Remove, clean and reconnect as necessary.
120V operation:
For the 120V electric operation, the fridge usually has a normal plug in the back. Verify that it is plugged into a live socket. (You can test the socket by plugging in an ordinary household 120V light if necessary).
If the socket is live, the next spot to verify is inside the little black box. Take the cover off and, using a voltmeter, CAREFULLY check the glass fuses. One* of those is for the 120V, and is usually a 5 amp one. If the fuse is blown, replace it with one of the correct value, usually indicated on a label inside the box lid. The electric heat should then work and the Check light should no longer come on when the RV is plugged into 120V.
*On a Dometic fridge the fuse is labelled F5
AGAIN, the make and model of the fridge (or any other appliance) is important in order to help you with more accurate information. The model number of the fridge is often found on a label on the inside edge when you open the door.