Here's an easy way to pickup all the magnetic crap that accumulates along your tracks, simple and to the point.
Start with a super powerful Neodymium magnet, mine is a 2 x 1 x 1/2 inch one, it's used in wind generators.
I found this little tender car, and it was perfect for the task. It even had plastic wheels, which are necessary for this task, the magnet is strong enough to stop diecast wheels from rotating, it just drags the car along! You can either push this in front of your locomotive or add it to the end of the train. The beauty of this approach is when you get done running and collecting, you just hold the car over the bench (or wastebasket) and remove the magnet, all the stuff drops off! I ran this around our club layout, and it was amazing all the stuff it picked up, including several lost rod screws, etc.
Just drop the magnet in the car, connect it up and take it a couple laps around the layout.
This is the car I started with, only because I happened across it. I used the same one for a tender on my K-Line Porter to haul it's electronics around for the command upgrade.