Judge Amit P. Mehta said the company must hand over some of its search data to rivals, but did not force other big changes the U.S. wanted.