DES MOINES, Iowa — A first-time candidate defeated a longtime elected official by just 42 votes in last week’s primary election, and now both Democrats are preparing for their next political steps.