Maybe not electrolysis
On my 34, I have a new toerail, and an original. The old one has corrosion evident in the crotch between the aluminum and the fiberglass where the water collects. While it could be electrolysis, it may be simple corrosion - as even hard anodized aluminum in a preferred seawater alloy will corrode over time - so, depending on the year of your boat, maybe it's just simple corrosion (all of which is ultimately electrochemical anyway), but not necessarily tied to a larger electrolysis issue. Just a thought.