Federal judge rules against N.S.A. phone data program