(a) Paint works as a physical barrier. It seals the iron away from the air and the moisture in it, and rusting cannot begin unless both reach the metal.
Its weakness is that the protection is only as good as the barrier. A chip, a crack or a scratch lets air and water straight through to the iron underneath, and rusting starts at that spot — and then spreads beneath the surrounding paint, lifting it off as it goes.
(b) Galvanising coats the iron with zinc. This also acts as a barrier, but it does something a barrier cannot: because zinc is more reactive than iron, the zinc is attacked in preference to the iron wherever the two are in contact.
So a scratch in a galvanised surface does not leave the iron open to rusting. The more reactive zinc around the scratch reacts instead, and the iron is left alone until that zinc is used up. That is precisely the weakness paint has and galvanising does not.
(c) Galvanising. Cables on a bridge are constantly flexed, rubbed and struck by wind-blown grit, so a painted surface is certain to be broken somewhere; and sea spray is salty, which speeds corrosion considerably. A protection that survives being scratched is worth far more here than one that does not.