It probably isn't worth washing them. You could try washing them with water alone but this certainly won't remove many types of dirt such as oils. The main flavour compounds in most spices are not highly soluble in water, so most of the flavour (Hydroxy-alpha sanshool in this case) will remain. However, if you used a detergent to remove any oils, it is likely that this will also wash off some of the flavour compounds, and likely be difficult to remove from the seeds. You would also need to dry them thoroughly after washing, especially if you wanted to store them.
You may be able to bake them - it seems that the Hydroxy-alpha sanshool has a boiling point of 574 C (1065 F), which is much hotter than most ovens will reach. However, this risks burning them and thereby destroying the flavours before you can sterilize. Dry heat at 176-232 C (349-450 F) is sufficient to sterilize food with dry heat (see section on sterilization by heat in chapter here (paywall?)), however these are baking temperatures and will cook the seeds quite rapidly, so you will most likely burn them before you could cook off any dirt and before most bacteria get killed. With this method you would still be eating dirt, it just wouldn't be able to make you sick.
A third option is to just pick them up individually - so as to not scrape them across the floor any more than they already have, then place in a sieve, shake up and down a few times to winnow (in the intransitive verb form) out any particulate dirt. Then store, and consider that cooking them will very likely kill >99.99% of any contaminating bacteria/fungal spores.