OK! Sounds like new user and that often means extreme confusion. I don't want to seem to talk down to you but there are some basics that we can get straight to make sure we are talking on the right level and all are speaking the same language!!
Easier to avoid lots of confusion if we can get the confusion out of the way upfront. no offense intended if you already know some of this stuff?
I like to thing of the RV as having three sets of electrical stuff that connect at times and places and disconnect at other times. That can make it really seem too much to handle, so I like to look at each set alone and then we can talk about how they connect.
Easier for many to understand is the part lots of us know from using cars or trucks.
That 12VDC part is the same as a normal truck. Chassis battery starts the engine that has an alternator that charges that battery and also runs headlights, wipers, and outside clearance lights like a truck would. Also there is often a 12v outlet on the dash like a truck might have!
So if the truck won't crank and start, it is in the normal wiring that a truck has! Chassis battery has to be good, cables from ground to that battery good and cables from battery to starter solenoid have to be good. Just like a truck, because the RV is built on a truck chassis that they buy from whoever builds it and lots of the parts are already there, so we need to search and look for what is wrong with the truck!
Sometimes the parts are hidden or there are some RV which have a chassis battery disconnect switch that has to be on. Some do, most don't, so don't worry if not found!
There is also the coach 12VDC system that has the coach batteries and powers most of the inside things like inside lights, fans and water pump, etc. It gets power from a converter/charger that takes AC power from the cord or generator and makes 12volt DC. The generator starts off the coach batteries and many of the controls for air and furnace also use the coach 12Volt.
Third system is the 110 AC from the cord or generator that makes the converter work and also feeds power to the 110 house type outlets and big power users like the microwave and air conditioners.
I would suggest looking at the "normal" truck group first as the far more simple one that we may know some about already?
Sometimes getting one working also makes the other work, too!
To get a truck to start, we have to have a good connection from the ground to the charged up new battery and on to the solenoid (switch?) Good clean connections of both positive and negative posts?
Then a cable has to take the power to the solenoid on the side of the starter.
When we turn the key, the solenoid closes contacts that put power to the starter to turn it.
Do you mean you can crank and start the engine when RV is plugged into power? That would seem the AC power makes the 12VDC going to the coach batteries and that power gets passed to the chassis to start the engine!
This is a normal connection that is made when we turn the key and it connects the two groups together to let the alternator recharge the coach batteries as we drive! But it can confuse the heck out of us until we know that, right?
Since the batteries just had work, I'm guessing the cables on them are not quite right or making good connections.
Since the coach 12V is a problem too, I might look at the cable from the negative posts to the ground and be sure it is clean and connected well.
My basic idea is that the batteries do not work because they have no ground but when power comes from the cord, the converter is "making" power to do things!
Click these snips to get a better look at why I think both coach and chassis batteries have the same problem and may use the same point to get that ground!
Chassis drawing of battery
Coach drawing of coach battery
When the cable I marked with red slash is open, neither battery will work and they both go to the same place, so look that over carefully and see if it makes sense.
Let us know what you find and if my guess is wrong, we can go in other directions. Just looking for the first guess, at times?