The court found that the Education Department acted unlawfully when it abruptly discontinued multi-year grants meant to fund school-based mental health services.