Praise be to Allaah.
Firstly: you have to be certain
that the walls of the washroom are naajis.
Secondly: If you are certain
of that, clothes do not become naajis simply by brushing against something,
unless the clothes are wet or the walls are wet, which would make the
najaasah (impurity) stick to the clothes.
Thirdly: If you are certain
that that has happened, then pray in the naajis clothes. But in this
case you have to remove the najaasah itself from the garment, by washing
the spot where the impurity is. If you cannot find a clean garment,
pray and do not repeat the prayer, because Allaah says (interpretation
of the meaning):
“So keep your duty to Allaah and fear
Him as much as you can”
[al-Taghaabun 64:14]
I’laam al-Musaafireen bi Ba’d Aadaab wa Ahkaam al-Safar wa maa yakhuss al-Mallaaheen al-Jawwiyyeen by Shaykh Muhammad ibn Saalih al-‘Uthaymeen, p. 9