There are paints designed for use in harsh environments, specifically aimed at aluminium railings - you may need to brush coat rather than spray if there’s too much wind but spraying is preferable - a good clean immediately before painting is essential - there are often surface prep products applicable to the chosen paint that can help. Clean the cured primer surface before applying topcoats. Better still unbolt the railing and paint it out of the wind and salt.