If the rust is under the paint (paint will show bubbles that break open in the end), the rust comes from the inside and is therefore difficult to treat.
This is because the roof is rusting from the inside.
The sunroof construction is kind of a metal box above the roof lining.
This box is not vented well and therefore after some years (if not waxoiled when the car was new), this area could get rusty.
The other day I had a look inside my sunroof "box" after taking the sunroof out and......