Justice Sonia Sotomayor’s remarks appeared to be a rebuke of recent attacks on the judiciary by President Donald Trump and his allies.