Your lighting runs off 12v DC power. While on shore power, the battery charging system supplies 12v by converting shore power to 12v, so you have a continuous supply of 12vdc without draining the batteries. It appears you no longer are getting that continuous supply, so the lighting is now draining the batteries instead. That suggests a faulty inverter/charger (or converter/charger, if no inverter is present). When you started the engine, the engine alternator took over the charging function and restored some battery power, but it will probably go down again.
If the alternator can charge the batteries, I doubt if you need new ones (yet). If they were bad, they would not charge from any source.
The charger function of an inverter usually works all the time, whether the inverter is "on" or not. Some models have a switch that specifically disables charging, but it still defaults to having an active charge mode. Turning the inverter on simply makes it available to supply power 120vac power to appliances when and if shore power or generator is not in use. What brand of inverter (or converter) do you have? That info will allow us to tell you in more detail how it works.