The case offers a rare look at the military’s handling of mental health issues during extended deployments.