WASHINGTON—Democratic congressional leaders said President Trump agreed to aim for a $2 trillion infrastructure package in a White House meeting on Tuesday, though the two sides didn’t discuss how it would be paid for, and Capitol Hill Republicans are unlikely to go along.

“I like the number you’ve been using, Nancy,” Mr. Trump told House Speaker Nancy Pelosi (D., Calif.), according to a Democratic aide. “Two trillion.”

In...