Rust can be a problem with any kind of wrought iron railings or furniture. You can try avoid the onset of rust by investing in the type of wrought iron gates that may have finisher on them to prevent it, or by a primer that could prevent the onset of rust. Also by just maintaing a regularly cleaned gate, this can prevent rust to a great extent.
Sandpaper is always the best solution the first time you see a bit of rust. This needs to be done as quickly as possible otherwise it will take more time to get rid of it. When using the sandaperp make sure that you focus on where you are brushing, you would not want to scartch off any paint and ruin your gate. Once you have cleaned the rust off, think about adding some more anti-rust that area so it does not come back.
Repaint as Needed
After some time it always happens that your gate begins to lose its paint and bit fall off and are scratched off, it is not a very hard job to fix if you have the time for it.Rust and paint do not go well together, so ven if the paint is fine but there is a lot of rust to deal with, you should maybe just repaint to prevent any further spread of rust. So now you will need to sand down the gate untill all the rust and most of the weak paint is off, it okay to leave some paint on, this wont effect the look. A sturdy wire brush can expedite this process.