This is why you sign up for an international treaty that has teeth, ratify it, and back it up with penalties including carbon tariffs.
Country B could tarrif country A in return and some countries cannot afford the cost of what that may do to them.
So you end up with an international treaty without international conformance or a treaty with no real teeth because the signee's have contributed to it what would allow "them" to game the treaty.