A Democrat flipped an Iowa Senate seat for the second time this year in a state that has been won by President Donald Trump in the last three general elections.