Even flawed governments operate within boundaries God permits. Nothing that happens on the geopolitical level takes God by surprise.
Our loyalty is layered...we submit until obedience to men would mean disobedience to God. There are countless times in Scripture where God's people were called to do what was right instead of what the law of the land demanded.