Though she blocked part of the California law, the federal judge left open the possibility that future legislation could ban federal agents from wearing masks.