Managing a difficult mentor is a problem of a different magnitude. It is rare that you might have dealt with a similar situation in your life. If your mentor is being harsh to you or unfair to you, it is best to avoid talking back to your mentor. It is best to keep calm and carry on with a myriad of responsibilities that you might have that day. You can request some time to think and consider your position on something before actually making a comment. Remember you can think more clearly when you are calmer and not emotionally charged.
You could be a whistleblower if your mentor is violating university policies. But that could jeopardize your academic career as well. In the worst case scenario find the HR from your university to support you in dire circumstances. If you do such a thing you will be threatened with a bad recommendation. Even if you go along with your mentor there is no guarantee that you will get a good recommendation.
It is also important to understand that your mentor is also human with family pressures and pressures from a high profile career. So when they lash out at you it could be more to do with them than with you. In such scenarios answer harsh criticism or nosy question as generously as possible.
Get your family involved in this, friends or loved ones that you can trust your problems with. If everything fails it is time to consider leaving your mentor. Because of it important to be safe and happy in your life, and you do not want to be clinically depressed. If you mentor triggers certain stressors it is best to avoid them in the long run. Pay attention to your health and well being and take extra care of yourself.