if aluminum, do not use treated. you can use cypress or oak or ash however only cypress would have any amount of water resistance.
if fiberglass, treated, cypress, oak, ash, etc.
Here's what I'd do. I'd use 2x Douglas Fir and soak it really well, and I mean Saturate it with a mix of 33% Boiled Linseed Oil, 33% Mineral Spirits and 33% Marine Varnish. Pour it on till it pools on the surface and let it soak a long time. If it soaks it all in, add some more till it won't soak it any more. Wipe off the excess then let dry for 2 days in the Sun. Then give 2-3 coats of the Marine Varnish or Acrylic Enamel Oil Based Paint. Cover with Marine Carpet with Stainless Steel Staples and those bunks will never rot.
I used fir. Saturated it with CPES (a penetrating epoxy) and then painted with Rustoleum oil based paint. Drilled all the holes before any treatment so I could protect the insides as well. Holding up good so far. Of course the original ones were untreated fir and they lasted almost 30 years
My originals were treated and the carpet was just stapled. The carpet always seemed loose. I just replaced them with #2 fir from Lowes... I picked thru the stack to find some knot free boards. I wanted to be able to use some carpet glue to help hold the bunk carpet. The treated is too wet and glue will not stick.