I've been painting and weathering my rails for decades and I don't have any dirty track problems...at all.
Here's how I do it: After my track is down and fully tested, along with cosmetically where I want it (ties replaced, solder joints minimized, feeders properly disguised) I apply a thorough coat of Krylon Camo Ultra-flat Black to the sides and top.
I let that dry for a little while...like ten minutes or so until it sort of dry, then I use a Bright Boy to clean the tops of the rails. I let it dry for another hour, then I test it electrically by running an engine on it and cleaning away any paint that may be inhibiting good electrical contact...this is usually done by just using the Bright Boy again, but if your closure points on your turnouts are powered only by contact with the adjacent stock rails, or if power to your sidings is provided by those closure points...make sure you tape them off before spraying...and hand paint them afterwards. It can be a real PITA to clean them after they've been sprayed.
After the Krylon has dried, I apply a coat of the appropriate tie color by spraying from directly above the tracks, so that the full spray doesn't hit the sides of the rails, but gets the tops of the ties best, the sides of the ties too...and overspray tints the sides of the rails...so that they're not dead black...but now sort of a rusty gray.
This is a light coat of paint, and can be applied using a spray can or airbrush, so do the tops of the rails Bright Boy-ing again and test (always test).
After this, I go over several individual ties every six inches or so with different colors of "tie" brown for variety. This goes fast, and adds a lot to the appearance.
Then I ballast my track with real rock ballast (I use Highball) that I've mixed to look like U.P. mainline ballast in Weber Canyon.
After the ballast is dry and I've picked the loose chunks off the sides of the rails and tops of the ties...and retouched those spots, I weather the ballast and rails/ties with my airbrush using blacks and reddish browns, to represent both the weed killer UP sprays on its mainlines (rusty red) or oil/cinders on the uphill grades.
Clean and test again
Although this sounds complicated, it isn't and goes quickly.
I have never had a problem with dirty track, and the Krylon is strong enough that it stays on Delrin ties and un-cleaned rail sides very well...and forms an excellent base for detail painting and weathering.
Only drawback is that it stinks. Use a mask when applying.
Here's a shot at Echo Curve with track done using this method.
