The engine alternator is one of the ways to charge batteries.
Next, the generator and the 3rd, if you have it, solar.
If your battery charger craps out too, hang on tight and head to shore.
Of course if you have solar, you can limp back to port without too much fear. Pray for long sunny days. Of course, cold food (unless you have a gas stove or a gas grill), cold showers (unless the engine heats the water), and no internal lights. Oh yes, limited water unless you have a 12vt water maker and use it only when desperate. Remember the FW system uses a 12 vt pump so hope you have a drain at the bottom of the tank. The 12vt head pump? This is when you wish you had a manual/ electric toilet.
The meek will inherit the earth but, the brave will inherit the seas.