I have a C1/D visa. I will be going to Mexico and the transit of the U.S. is 17.05 hours. In this case they will let me rest in a hotel?
Your visa status will not prevent you from staying in a hotel. A visa of this type lasts for 29 days, and no one expects that someone who is permitted to stay in the U.S. while in transit for up to 29 days needs to sleep in the bus station or in a tent in a park.
Furthermore, lodging places in the U.S. do not generally evaluate the immigration status of people who stay there. There is no mechanism in place to regulate what someone with a valid and unexpired transit visa does while that visa is in force, other than employment unrelated to the visa for which the I-9 form filing requirement for prospective employers would lead to a denial of employment.
Whether your employer will permit you to dally in a hotel for a while on a trip that is only 17 hours long is another matter, but not a legal one that can be answered at Law.SE.