I'm not a patent lawyer and the legislative framework regarding the status of the WTO agreements in the US is pretty complex, but under FSIA a US company by itself doesn't have a lot of recourse if a foreign government decides to compulsorily license a US patent to a company in that foreign country. Basically the US company mostly can't sue the foreign government directly, unless there are some other treaties that allow that.
Although a seemingly infrequent issue, the ability to sue domestic and foreign sovereign entities in intellectual property disputes has been the subject of recent seminal U.S. Supreme Court and Appellate Court decisions. In these decisions, the Courts addressed statutes that seek to abrogate sovereign immunity to allow suits by private individuals against foreign and domestic states in intellectual property actions. While the Supreme Court has now made it clear that a state cannot be sued for copyright (or patent) infringement, the Second Circuit held that a foreign entity may be sued in U.S. courts under certain circumstances. [...]
Applying the FSIA commercial activity exception, the Second Circuit Court of Appeals denied the Welsh Government’s motion to dismiss Pablo Star’s complaint for copyright infringement based on sovereign immunity. The Court found the Welsh Government’s use of two photos of Dylan Thomas and his wife in promotional material for Welsh-related tourism in the United States fell within the commercial activity exception. Pablo Star Ltd. v. The Welsh Government, 961 F.3d 555 (2nd Cir. 2020).
According to FSIA, sovereign immunity does not preclude jurisdiction in U.S. courts if the action is “based…upon commercial activity carried on in the United States by the foreign state.” 28 U.S.C. Sec. 1605(a)(2). Thus, to be able to sue a foreign state for copyright infringement as commercial activity under this provision, the action must meet the two statutory requirements: first, the action must be based on “commercial activity,” and second, the activity must be carried on in the United States.
[...] a suit can be brought in U.S. courts against a foreign sovereign for copyright infringement (and likely patent and trademark infringement) if the infringing action is part of the foreign government’s commercial activity in the United States.
So it looks like FSIA generally precludes [private] lawsuits (in US courts) against foreign countries/sovereigns for what what they do in their own territory/jurisdiction (unless some treaties say otherwise.)
If, on the other hand, the US government is opposed to such a compulsory licensing measure it can "raise hell" in various ways from direct sanctions to actions at the WTO (back when it still had a functioning dispute resolution mechanism, which the US has mostly sabotaged in the meantime.) Anyhow, what I'm trying to say is that the position of the US government matters, a lot. It can/does basically act as proxy protecting US companies in IP matters.