Trump’s lawyers said he barred three news outlets from the White House on security grounds. A judge seemed skeptical.