You need it for custom stamps?
There is one in Brig and one in Domodossola, but both are not located at the railway station. You would have to leave the train. I don’t think the amount will be worth the extra stop?
This is the main phone number from Swiss immigration & customs, you can ring them to check where to stamp the goods if you have to get it stamped, though: +41 58 467 15 15
Border crossings and customs offices, opening hours (admin.ch)