If the power pickup is on the wheels (instead of little shoes that ride along the track), you can make a wiper with two brass strips sandwiched in some styrene to provide power to the wheels when the loco is upside down. The wiper will look like a "H" - you connect power to the top legs, and put the bottom legs on the pick up wheels. That will let you turn them as you clean with q-tips and alcohol, of whatever you have chosen.
Don't forget though, that the rolling stock all have wheels
and will need cleaning too. You can do this with the same materials. If you do try a dremel tool with a brush ** don't ** use a wire briush on plastic wheels, and don't let the wheels spin, as the heat that is generated may melt the needle-point "bearings" on the axels.
Andrew