Interesting question, I like it. Eating a healthy diet and getting regular exercise has been proven to improve mental health. At the same time, mental illness can destroy even the most physically healthy individual. Imo if your mental health is down the toilet, that would affect your ability to make healthy food choices/get enough exercise. If you can't even brush your hair, you probably won't go for a walk every day. Making healthy choices can improve your depression though. It won't cure it but it's a step forward.
If you're having a mental health slump but are otherwise healthy, diet and exercise might be enough. Maintaining mental health and preventing mental illness vs treating a mental illness, you know?
I'm going with the latter - mental health affects your diet and lifestyle more. Especially if it's something like agoraphobia.