All congresspersons have great investment in their positions and none give them up lightly; ergo, I believe that Senators Corker and Flake were no longer willing to keep up the charade of party above nation.   They can be criticized for waiting until they were no longer under intense scrutiny before making their anti-Trump comments, but are now perhaps able to live with themselves  -  and to be more effective than they were.
Their actions were not too different from NFL players, who could have lost their positions as a result of kneeling for the national anthem  -  but no, they did not quit beforehand.