If the metal is steel: blueing
https://www.amazon.com/Birchwood-Casey-Super-Blue-Liquid/dp/B002J1QBEC/
I have not done it personally, as I haven't had metal tracks on my tanks yet (3d printed so far), but I read about using gun-bluing solution to get a nice black finish on tracks. Here's the article I found: https://www.rctankwarfare.co.uk/forums/viewtopic.php?f=38&t=11034
Be very careful with that solution though, as it's an acid, so rubber gloves, eye protection, a mask, and a well ventilated area. Fortunately since it's designed to be used on firearms, it allows for moving parts, where I think a spray paint might gum up the works a bit.
The amazon link in the article is dead, but this is what he says he used: https://www.amazon.com/Birchwood-Casey-Super-Blue-Liquid/dp/B002J1QBEC/