RICHMOND, Ky. — At 5 a.m. on Election Day, Mark Nickolas awoke to write a speech he thought would never be delivered.

Mr. Nickolas, the campaign manager for Amy McGrath, one of the Democratic Party’s most high-profile candidates for Congress, quickly drafted a 400-word concession, printed it, sealed it in an envelope, and then deleted it from his computer.

He had hoped to burn it after Ms. McGrath claimed victory. Instead, at 8:28 p.m., he pulled out the envelope and handed it to her.

Ms. McGrath’s loss to Representative Andy Barr in this central Kentucky congressional district made vivid the yawning divide between rural America and the rest of the nation. Her campaign’s election model called for her to win 57 percent of the vote in Fayette County, home of the district’s largest city, Lexington, and the University of Kentucky. She won almost 60 percent.