Opposition to Mr. Duterte in the Senate had been already weakened by the 2017 jailing of Senator de Lima, one of his most vociferous critics. Another prominent anti-Duterte senator, Antonio Trillanes, is not seeking re-election.

Most of the anti-Duterte candidates in Monday’s election carry long odds, according to the polls.

One of them, Chel Diokno, a human rights lawyer, has taken on Mr. Duterte’s antidrug war in the courts, helping relatives of some of the thousands of Filipinos who have been gunned down by police officers or vigilantes.

Mr. Diokno, who teaches at De La Salle University College of Law, said that despite the odds, he was inspired by what he said was growing support. The president has verbally attacked him, which he said had helped to raise awareness of his candidacy.

“I realized that silence is no longer an option when people started being killed every day and our democratic institutions are being attacked,” Mr. Diokno said after a campaign rally in Manila on Wednesday, where he spoke to an enthusiastic crowd and was endorsed by prominent former judges and prosecutors.

If elected, Mr. Diokno said, he will try to address the low conviction rates in the Philippine courts, which many see as a reason Filipinos have welcomed Mr. Duterte’s bloody antidrug campaign.