Re: Charger failure or battery?
Ah, the two year old battery syndrome. LOL.. Maybe I can help. Batteries that are used for trolling motors, etc., tend to last only about two years. The major cause is the repeated discharging and charging. Just recently I noticed battery manufacturers listing charge cycle ratings in their specs. I'm not sure if this is a requirement now or a way of informing the buyer what to expect and help them understand the warranty better.
Anyway, a battery can only withstand a certain number of charge cycles and after that they're gone. There is a logical mechanical explanation for this but I won't bore you with all that gobbly gook. Just realize that the better the batteries internal components the more charge cycles it can withstand.
With your onboard charger you're probably pugging it in when you get home and leaving it on to float the battery. That counts as one charge cycle. If you're battery is rated for 180 charge cycles (a good marine battery) that's the manufacturers safe estimate of how many times you can do that before the battery fails to charge. Some get less and some get more mostly dependent on the abuse the battery gets in the boat.
So what's bad, the charger or the battery. The battery, the charger will not charge or indicate a charge cycle has begun unless the battery is capable of accepting a charge.
Moral of the story, replace your batteries bi-annually. It's part of owning a boat.