Yep, they corrode. Ours has.
The prevention is a fresh water rinse. Always rinse your boat of salt before putting it away. It's kinda like a 'wet horse'. Well, bad analogy, 'wet horse' is a myth.

Anyway, back to the rail corrosion. Pitting is evident where aluminum is in proximity of stainless steel. That was caused by too long of an interval between washing after being drenched with saltwater in the early years of our boat and the subsequent cruise. The fix is in place. The boat is rinsed when brought into her slip. If anchored, (we always anchor while cruising) the boat is washed with our new deck-wash. It's sold by Newfoundmetals.com. Of course, it looks weird to see a boats' crew using freshwater to wash her down in an anchorage. We've noticed several people taking a picture. Two have even come over and asked about it. Our watermaker makes sixty gallons an hour of fresh water. That works out to about the flow rate of our deck-wash needs. We never have to stop washing until be run out of fuel. Fun.

Too bad we didn't notice the corrosion beginning sooner. Once it started, washing was mandatory. Of course, all other topside components benefit from rinsing, from the mast on down. 'Rinsing' is THE maintenance instruction from Harken.