Brazilian communities win landmark court case