"Can the other two branches of government (Supreme Court & Congress) legally deny Trump the position of Commander in Chief?"
According to the Constitution, obviously not, unless and until he commits "high crimes and misdemeanors," and then it is up only to the House and Senate.
And the alternative to Trump is an obvious liar and crook.
We are in BAD shape.