I think there is confusion between a TM and a Registered mark. You gain a TM by using a business name or product name in the commercial world. IE- I have used DNQuest for business for over 3 years. It is a domain name site. Due to this commercial usage, it became my TM. There is no cost or nothing special you have to do to hae it be a TM.
On the other hand, a registered mark is a TM that is registered and verified by the government as a TM. This is where you would see the ® next to a name or product. It is better to have the ® than a TM. ® is easier to defend since you already did the work on your application to the government and the government said you are the registered TM holder.
Copyrite is the protection of content you publish which is assumed once it is published.
So with this, if the first company had been using the domain for commercial business as a hosting company, the second company would be infringing on thier TM. Just having a name does not give TM status, using it for business does.