The lawsuit was filed by the advocacy group Democracy Forward on behalf of the Easthampton and Somerville schools.