A three-day trial opened Monday in state officials’ challenge of the legality of the deployment, which followed protests over immigration raids.