This would be considered kibus (laundering) on shabbos, and hence forbidden. But is it considered laundering in the 9 days?
Dinonline says that it is allowed:
Yes, you can spot clean during the nine days. If that won’t work for you, you can also put a pair of (freshly-laundered) pants on a dirty floor, and stamp on it until it no longer has a fresh feel to it, and then wear it.
Italic comment is mine to express what the author means.