Are you running your inverter while starting the genset? The transfer switch (as I'm sure you know is a AC switch, DC has nothing to do with it) It can sense the power from the genset (it does this inductively with a coil) then will switch to use the Generator power. Since this is not constant power, the switch will default back to the inverter when power is removed (the normally closed position on the switch).
Dead batteries are very difficult to troubleshoot (when used with another good battery, like in an RV). The reason for this is the good one is constantly working it's guts out to make up for the bad cell in the bad battery. Circuits will act differently because of this increase in load. If you were using your inverter while starting the genset, this may explain the problem you were seeing. The inverter may have been outputting low voltage, which could have lead to switch chatter, which may have lead to the x-fer switch failing.
It's an all encompassing system, and unfortunately thats what can happen. If this isn't the case, well guess what it's electrons so the FM theory comes to mind

(friggin magic for those ho aren't familiar).
IMHO, you should always replace BOTH batteries when one fails. The "good" battery is damaged from the bad one. Replacing just one will result in premature failure of BOTH. Keep the "good" battery as a spare.
I've gotten very intimate with my RV system, and ran into a rather simple but easy to over look failure with my converter last year. High resistance short across a couple fuses caused it not to work.
www.klenger.net is a great resource. Ken has a great write up on RV electric systems. I used that to help me draw my own schematic from tracing all that wires.
Also, from experience, RV's are assembled by morons. I repaired more "cheesy" electrical connections while troubleshooting my inverter problem last year then I ever have before. I have a Lance, supposed to be the best in the business. Yeah, well tell that to the guy making 2 bucks an hour puttin it together. It was pretty cheesy to me. Take the time and make sure all your fittings are snug, escpecially the DC connections. People have little knowledge or respect for DC, it's DANGEROUS stuff in an RV.