Remarks by the liberal justice came as President Donald Trump and his allies have harshly criticized judges for blocking his agenda.