The opposition’s stunning victory offers lessons for U.S. Democrats—and a warning for Trump’s allies.