Article II of the Constitution does say that "The President, Vice President, and all civil Officers of the United States shall be removed from Office on Impeachment for, and conviction of, Treason, Bribery, or other High Crimes and Misdemeanors". So it is true that a president or a federal judge could be impeached and removed from office, and it has happened to some extent 19 times – in 8 cases it went all the way to removal (as opposed to acquittal or resignation). However, this would not be a very effective way to avert a "crisis". Any judicial ruling is subject to appeal by a higher court, until you get to the Supreme Court. Moreover, impeaching a lower judge does not erase his or her rulings. So ultimately, a matter will be decided by SCOTUS.
In anticipation of such a ruling, Congress might decide to get rid of some Supreme Court justice who they think might stand in the way. That was attempted with Samuel Chase, who was acquitted. Such a decision is not subject to judicial review (Nixon v. United States 506 U.S. 224). However, SCOTUS can also overturn that decision though that would be very unusual. It would also be very unusual for Congress to impeach a Supreme Court justice for having a position that they disagree with.
At any rate, there is no such thing as a "deadlock" between branches of government. When the court rules, that is the end of the matter from a legal perspective. It is, in fact, entirely possible that a general will rule that the court or the president (or both) are wrong and will declare what the law now is, but that takes us out of the realm of legal discussions.