Some years ago I cleaned up a few hundred feet of Lionel and Marx 027 by first soaking then scrubbing (with a heavy kitchen type scrub brush) in a water diluted cleaner/degreaser (don't remember which at the moment, something from Lowe's), followed by a good rinsing and drying. Then inspected and did a continuity check to weed out any bad sections/insulators. Finished with a light scrubbing of the rail tops with maroon Scotchbrite pads and a mineral spirits wipe down. Didn't bother with the ends or remove any pins (unless already loose). Never had any issues with the resulting layout. I also passed on any heavily rusted track - used 027 is too cheap and plentiful to waste time and elbow grease fighting the seriously abused/deteriorated stuff, just to watch it rust over again. I'm hoping I can get away with just another good spirits wipe once the layout returns.
About the dumbest thing I did (too many decades ago when I was a whole lot younger...) was to use a stiff wire wheel on a bench grinder. Was just a bit overzealous in trying to make it shiny - rusted back almost overnight and heavier than ever, since the plating was now spread all over the floor around the grinder stand....