Grace delete, as others have said, is an option.
But keeping it is an option too, especially if it isn't a huge company trademark. remember, TM protection is only for a specific segment of the product. For example if the TM is for a food product, you would likely be allowed to use the name for a line of office products. So if the name is worth some extra work, look into it deeper and see if you might still be able to market it for a different use than the current TM. This assumes that you truly did register it on accident and didn't have any intent to gain from their goodwill. Also this is easier with a small company as the big company can harass you even though you are technically in the right. Unless you have deep pockets or it is an extremely valuable domain, it likely isn't going to be worth the fight to you. A small company may not ever even notice.
With regards to foreign countries, that is a great point. I have mentioned before that I typically check US, Canada and EU for TM issues on anything more than a minimal purchase. TM's are good only in the country they were issued, though most big companies are savvy enough to register their TM's in every country they do business in. So if it is not registered in your country, or area, then you can surely use the domain. But if your intent is to sell it, the market for potential buyers may be greatly reduced.