Hydrochloric acid aka muriatic acid, is very useful for removing rust and I bet most of you people trying to restore bikes, engines etc. have come across this issue at some point.
There are several chemicals out there doing similar jobs with rust but muriatic acid is my most common choise as it needs to be in the lab for other issues as well
e.g check the post for ...removing piston deposits from Nikasil Cylinders
Here is an example of some gears from a lathe that I bought a few days back.
Normally it takes about half an hour up to 2 hours to have the rust completely removed but this depends on how strong the acid is and rust scale. Do not omit to clean the parts thoroughly after removing them from the bath of acid. In a different pan, use plenty of water and baking soda. Soda neutralizes the acid and the process stops. Clean them out and oil the parts as soon as possible.