A benefits claimant with mental health problems has won his argument in the first case of its kind in Supreme Court.