WASHINGTON — Speaker Nancy Pelosi delivered a triumphant message on Friday as the House moved on legislation, long sought by environmentalists, to force the Environmental Protection Agency to regulate toxic chemicals that can contaminate drinking water.

“The Trump Administration’s E.P.A. is breaking its own promises every day that it delays and puts polluters ahead of the American people,” she said before 24 Republicans joined all but one Democrat to pass the act, 247 to 159, on the chemicals, known as PFAS. “In stark contrast, the House is taking action.”

But the measure, the PFAS Action Act, already has a veto threat looming over it, and its prospects in the Senate, like those of other House bills addressing environmental regulation and climate change, are slim to none. In the meantime, critical legislation passed in the Christmas rush last month was signed into law, with environmental provisions and climate change measures watered down or omitted altogether.

“If you really want to understand what Congress’s true priorities are, you look at must-pass legislation — you look at what they give up and what they double down on,” said Representative Alexandria Ocasio-Cortez, Democrat of New York and one of her caucus’s most outspoken climate advocates. “And if you look at must-pass legislation, this Congress is engaged in climate denial.”