Disconnect the battery terminal cables and connect with a DC Voltmeter at suitable range 12/24V
start the genset if there is proper voltage than its battery problem, change the battery!
else check at direct output Voltage of the charging alternator at its terminals, while DG is runiing, if its not there than change charging alternator!
if its missing some where in between refer the electrical drawings and chek where is the fault
__________________
Please save the power for Next Generation- Do ur bit
Test the output voltage by connecting a small 5W-12 V bulb as load , instead of battery, first. Then, if there is no voltage at all, let's think the possible defects. The most often you find a fried regulator transistor on those 12V/24V battery charging alternators. If you can get in the alternator you have to look for a compatible VOLTAGE REGULATOR for alternator's exitation coil and to change it with the good one. If you have someone good on power electronics to help you even you can do the repair by changing this power transistor only. Another possibility is your alternators three phase bridge may be defective, which can be replaced with a good one.
All these tests and repairs should be done by someone is familiar with electronic repairs. Otherwise don't bother at all and just ask to your local starter/alternator rebuilder shop to exchange your bad one with a rebuilt one for a reasonable price.