On Wednesday, the men two had lunch. (The menu: shrimp, beef and chocolate cake.)

Ostensibly, the meeting in the White House was to discuss the Gateway project, a proposed train tunnel under the Hudson River that The Times called New York’s “most pressing infrastructure problem.”

At the lunch, Mr. Cuomo failed to obtain a promise of funding from Mr. Trump.

But the meeting also exposed a dilemma that Mr. Cuomo and Democrats nationally face: They must oppose Mr. Trump at all costs, but they also can’t stand in the way of progress on key projects.

Mr. Cuomo desperately needs to improve mass transit in New York. To do so, he needs federal money, which means he needs Mr. Trump’s support. It’s a tricky balance.

“We have to figure out what we believe in,” said Rebecca Katz, a Democratic consultant who worked for Cynthia Nixon, Mr. Cuomo’s opponent in the primary. “What does the Democratic Party stand for?”

Mr. Cuomo’s father, Mario, the former three-term governor of New York, was fond of saying, “You campaign in poetry; you govern in prose.”