If the paint is flaking off, it's no longer adhering to the metal below and is thus already ruined. Acid treatments like Naval Jelly can remove rust, but the acid has to be able to get to the rust and the bare metal that's rusting, which generally means removal of loose, flaking paint. Remove the lifted paint, remove rust, then prime/repaint.