With just over $200,000, David Brat, a professor at Randolph-Macon College in Ashland, Va., toppled Mr. Cantor, repeatedly criticizing him for being soft on immigration and contending that he supported what critics call amnesty for immigrants in the country illegally.