WASHINGTON — President Obama ridiculed Donald J. Trump on Tuesday for saying that the presidential election was rigged against him, telling Mr. Trump, the Republican nominee, to “stop whining and go try to make his case” to win more votes than Hillary Clinton.