With the electrolysis removal, you want a solution that is very conductive. Your are reversing the natural corrosive galvanic cycle of anode,cathode, electrolyte and conductor path by using a forced electrical DC current to make the anode the cathode. Vinegar will work, as well as baking soda or good old salt. If you use copper pipe as the anode, put a milli-ammeter across on a jumper wire connecting it and the steel/cast iron you are cleaning the two (without the battery charger attached). The higher the amperage the better the conductance of the solution.
For direct chemical removal of rust from ferrous metals, phosphoric acid is the best acid to not cause any other side issues. For direct chemical removal of rust, sodium hydroxide (draino crystal type) is also a very good solution. It will remove paint (not polyurethane or epoxy) like enamel, varnish, or lacquer, greases except for silicone, and rust. Heating it speeds the process. DO NOT put any aluminum in sodium hydroxide.
Positives of acid: Can use lesser concentration, easily neutalized. Coatings adhere best to a slightly acidic surface. Negative: SLower unless in very high concentration. Starts corrosion immediately when current removed due to the oxidizing nature of acid. Best to immediately rinse it with baking soda solution (neutralize the acid) and a slightly base (alkaline ) solution (a diluted amount of greased lightning will probably work well but best to rinse it if you are going to paint it later, or spray it with WD-40).
Positives of strong alkaline: Removes grease, oil, paint and rust in one step. Negatives: Very hazardous (dissolves flesh, bone, eyeballs, aluminum,etc quickly. Thats why it makes a good drain cleaner and they used to use it at slaughter houses to dispose of the unwanted remains. Today they turn the waste into Spam and hotdogs and sell it at the meat counter:lol::lol
. Harder to neutralize, making it harder to dispose of (if you dump it in your yard, nothing will grow there for about five years, and all the vegetable matter will turn into an icky black goo. DAMHIKT)
For added info do a google search for "corrosion theory" and "galvanic scale". Haven't done that but should give you an idea of what the chemistry is.
Go