“Having been twice spurned by lawmakers, the Obama administration leveraged the Volkswagen settlement,” the groups charged. All settlement money, they argued, should “instead be deposited into the U.S. Treasury.”

The groups said that Congress has not authorized or provided money for electric vehicle infrastructure. They said the plan represents “an end-run around Congress’s lawmaking power.”

Such settlement funds can be appropriate in cases of environmental wrongdoing, some environmental lawyers said, because the victims are often scattered over large areas or are difficult to identify and compensate directly. At times, the government has ordered a polluter to pay for unrelated environmental restoration projects as restitution; the attorney general’s order would prohibit such deals.

Environmental groups say that settlement funds have gone to critical projects nationwide. The 2012 settlement with BP, in which it agreed to pay to resolve criminal charges, included more than $2 billion for projects aimed at environmental restoration in the Gulf of Mexico, and research into spill prevention and other topics. A 2015 settlement with Duke Energy allocated $4.4 million to stream and river ecosystem restoration in North Carolina.

“You’re killing something that’s worked really well — which is getting violators who’ve broken the law, in some cases in a criminal way, to agree to fund projects to make the air or water cleaner,” said Eric Schaeffer, executive director of the Environmental Integrity Project and the former director of civil enforcement at the Environmental Protection Agency. “What’s wrong with that?”

Mr. Sessions’ new policy directs Justice Department lawyers not to include similar payments in settlements with corporations. “The goals of any settlement are, first and foremost, to compensate victims, redress harm, or punish and deter unlawful conduct,” he said in his memo, dated June 5.

The House bill, known as the Stop Settlement Slush Funds Act of 2017, would turn that policy into law, making it difficult for future administrations to reverse.