Others have already provided correct answers but it might be useful to note that the very way you framed the question is at odds with the way international law works. The relevant law in a such a situation is first and foremost the local law. Beyond some limited things like the right to request that your consulate be informed of your situation when arrested, you do not have any general right to special treatment as a foreigner, let alone immunity from local law.
Even if there were some relevant international law (which there isn't in this case, as far as I know), it is still entirely up to the local legal system to actually respect it or provide a way to have the relevant rights recognized. I am stating the obvious here but there is no “international court” where individuals could appeal national decisions, no global police to enforce international law. There are also very few general rules that could be deemed to apply to any state (customary law and general principles) and most of what matters comes from treaties and therefore only applies to selected states (those that are a party to the treaty). Even from the perspective of international law, it's therefore important to consider which countries we are talking about and you should not expect any general answer. In fact, there is a ton of international law that stems from bilateral agreements and only applies to two specific states.
In any case, treaties are routinely ignored or violated and there is usually nothing you can do about it in practice. Even for egregious abuse (think shooting a police officer from within an embassy, kidnapping foreign nationals, etc.), the main things states can do, short of starting a war, is complain officially (there are traditional ways to complain varying in the degree of severity from sending a letter to breaking off diplomatic relations and expelling the other state's diplomatic staff). And even that would still not give you the right to drive in Mexico as far as the Mexican authorities are concerned!
Also consider this: Foreigners in your country can be arrested and punished in any way that is locally acceptable (including things that most countries object to like the death penalty) without asking their home state for permission. People trying to cross a border (no matter which one) can also be subjected to a lot of arbitrariness, interrogation and detention and still don't have any practical recourse. Also, war crimes, crimes against humanity and even genocide do happen and are still very difficult to prosecute or punish in any way. Why would you expect international law to protect you effectively from a relatively innocuous measure like the confiscation of a driver's license?
Finally, you have to look at it from the perspective of the state you are visiting. It is already doing you something of a favor by letting you drive with your US license. There are in fact treaties about that and a number of states that do recognize it (with or without additional documentation) but there is no a priori reason for your US license to be recognized by each and every state in the world. So here again, no general rule that would apply everywhere.
In this particular case, Mexico has good relations with the US so it's possible to imagine the local authorities would want to avoid displeasing visitors or perhaps that there is some special bilateral agreement between the two countries but what about Cuba, Iran or North Korea? It would clearly be inconceivable for the application of US law in the US to be contingent on these countries' legal systems and vice versa. At the end of the day, what matters is therefore the local law (or whether it is respected at all by the local police, which might matter more than the law itself in some countries) and the way traffic offenses are punished does not depend on anything else.
In light of all this, what you should be asking about is probably not about what happens to US citizens in unspecified foreign countries but what happens to locals and foreigners in Mexico.