A Massachusetts federal judge hearing a free-speech case stemming from the arrests of pro-Palestinian student activists said Monday he is grappling with whether immigration officials were carrying out an official Trump administration policy or using their own discretion to implement a broader set of priorities within the law.