Help! I''''ve got rust!
The tops of compression posts are notorius for corrosion, if there is a sealed headliner, then access becomes a headache.
On the bright side, it seems like you have at least some kind of access without having to remove the mast and work through the bolt holes (I have seen that situation).
Your best bet is a chemical nuetralisation of the existing rust problem and then a barrier against future corrosion (with a maintenance schedule that means you renew the barrier before further corrosion sets in)
There are numerous "Kill-Rust" type solutions on the market, available at both chandleries and auto parts stores. Do not buy a kill-rust based paint! You are after a rust converting liquid as thin as water. You can spray it in with a squirt bottle or syringe. Feel free to apply it to excess, it will not effect surrounding structures.
Any rust it usually finds causes it to turn blue, as an indicator that it has nuetralised the oxidization (rust). Ideally at this point you would brush the area with a wire brush and some emery paper to come back to clean metal before applying a barrier protection. This may not be possible in your case, though there are some truly tiny and intricate wire brushes available from auto stores these days (make sure the metal of the brush matches the material of the plate being brushed or you can promote electrolitic corrosion, but that is a small worry).
Next you can squirt in a gel type barrier coat like lanolin. Make it a good gel type thing with the consistency of grease rather then a thin liquid like WD40 (which is useless for long term rust protection). Lonolin is my favourite, but there are artificial products out there.
Make sure that there is no leakage entering the area via the through bolts to the mast base and you should be fine. Give another squirt of lanolin into the area in six months or so (depens on climate and local conditions, but that is the sort of timescale).
If the moisture causing corrosion is not the result of a leak through the bolt holes, electrical leads and other deck through-points, then it is likely the result of condensation. Solutions to this involve improved ventilation, drainage pathways in the headliner and possibly the instalation of an ioniser while the boat is closed up and unoccupied (this is really only practical if you are hooked up to shore power).
Hope this has provided some food for thought.