The race pitted two Democratic incumbents against each other after Republicans redrew the congressional map in their favor.