Mr. Trump’s comportment on Tuesday threatened to undermine his gains of the past month, and recalled his practice during the Republican primaries and much of the general election of belittling political bystanders in language that alienated voters, like attacking the Muslim parents of an Army captain killed in Iraq and a Hispanic federal judge.