Mr. Cruz said he had supported legislation to do more to protect American voting, but also focused on “political bias of big tech, of Facebook and Google” and said he was concerned that social media was not protecting free political speech on social media.

Mr. O’Rourke also criticized Mr. Cruz for opposing the Violence Against Women Act, while the senator presented himself as a strong supporter of the #MeToo movement and victims of sexual assault and misconduct.

“The #MeToo movement has done an incredible amount of good for our country,” Mr. Cruz said. “I believe everyone, women and men, girls and boys, need to be protected.” As the father of two girls, and the son and husband of women who had careers, he noted that he helped lead a Senate effort to stop secret settlements by members of Congress over sexual harassment complaints.

Mr. Cruz and Mr. O’Rourke were facing off for the second and perhaps final time, as Mr. Cruz seeks to widen his lead in the polls and Mr. O’Rourke tries to restore dimming Democratic hopes that he can unseat Mr. Cruz and pull off the biggest upset in modern Texas political history.

The battle between Mr. Cruz and Mr. O’Rourke has captivated and polarized Texas and drawn enormous interest nationwide, with the candidates raising far more money than those in typical Senate races. Mr. O’Rourke raised a record-breaking $38.1 million in the last three months alone, the most of any Senate candidate ever. And he has enjoyed a kind of pop-culture celebrity status, getting a shout-out from the young El Paso soul singer Khalid at the American Music Awards and jamming on stage with Willie Nelson. On Thursday, he will appear in a live town-hall event on CNN in the border city of McAllen.

Mr. O’Rourke’s CNN town hall has become a contested issue. The Cruz campaign asked CNN to change the format of the event into a town-hall debate and to allow the two candidates to hold their third debate there. In a letter to CNN, Jeff Roe, Mr. Cruz’s campaign manager, wrote that if they were going to spend an hour “on national cable news discussing and debating the issues important to Texas voters, we believe it should be on a stage with our opponent.”