At least Mattis had the sense to resign when he disagreed strongly with his Commander in Chief.
As for Austin (and Milley) they should have resigned instead of going along with Biden’s very ill advised evacuation plan. I am assuming they did oppose the plan. If they did agree then they didn’t deserve to continue in their jobs.