WASHINGTON — Senator Claire McCaskill, Democrat of Missouri, got her first tutorial about life as a woman in politics as a college intern at the statehouse in Jefferson City in 1974, when male lawmakers made lecherous remarks to her in the elevator; she took the stairs after that. When she became a state legislator in 1983, the lessons became more explicit when she asked the House speaker on the dais his advice for getting legislation passed.

“Claire,” she recalls his saying in a tone-deaf attempt at humor, “did you bring your kneepads?”

So “you can imagine how depressed I was,” the 63-year-old senator said the other day, recalling her reaction to news that a top Democrat in the Missouri General Assembly had sent explicit late-night texts to interns and that the Republican speaker of the Missouri House had exchanged “sexually charged texts” with a 19-year-old intern. Both men resigned last year.

It has been 25 years since Anita Hill testified against Clarence Thomas before an all-male Senate Judiciary Committee, and propelled the term sexual harassment into the national spotlight. Once again, the nation is debating gender roles, amid a presidential campaign that features a woman, Hillary Clinton, who stands a chance of becoming America’s first female president, against a man, Donald J. Trump, who has been caught on a recording bragging about kissing and groping women whenever he wanted.

Across America, women are increasingly emboldened to discuss the harassment they experienced. Last week, an Alaska lawyer accused Justice Thomas of groping her at a dinner party in 1999; he has denied the claim as “preposterous,” as he did after the charges made in 1991 by Ms. Hill, who is now a Brandeis University professor. Since the release of the Trump recording, more than 10 women have accused the candidate of groping them — accusations that he too has denied.