How can I prevent these steel poles from rusting?
Oil-based enamels "key" well to metal (better than latex) and are the go-to for protecting metal from oxidation. You will first need to remove all oxidation using some wet-dry sandpaper (or in extreme cases an angle grinder). There are products that will turn rust into primer; these can SOMETIMES help but really they're usually just a "quick fix", and in all cases you'll want something more than the layer these will give you.

As far as a more permanent fix, consider replacing these steel poles with galvanized metal. The galvanizing basically forms a protective layer of oxidation that is physically tough, and shields the metal from further destructive oxidation. Anything you'd use as a structural member exposed to the elements should have SOME form of protective coating already on it (or be made of an alloy that resists oxidation; stainless steel however is uncommon for major structural members).

In an oceanside climate, you can protect exposed metal by building a weather-tight box around the exposed part. This will prevent rain and saltwater mist from contacting the metal directly. You still will want to put a protective finish on the metal itself as a final barrier.