I expect the brushes have worn, ive had this before. The alternator still charges enough to distinguish the light but is no where near enough to replenish the battery etc.
If your lucky you will be able to get the brush/diode pack assembly out with it in situ, only 2 screws
And then try jump starting it again (obviously the alternator won't charge) but see if the rattling goes away.
if it does, jobs a good un fit a new brush pack and it will be like brand new, if not, alternator bearings are probably knackered.