Democrats are increasingly ready to acknowledge a problem at the southwestern border — House Speaker Nancy Pelosi last week dubbed it “a humanitarian crisis” — but their solutions lie almost everywhere but the border itself.

Sen. Bernard Sanders said he would be willing to talk about more detention facilities to hold illegal immigrants but that the real solution is deploying more judges to hear their cases.

Fellow presidential hopeful Rep. Tim Ryan says the answer to the surge of illegal immigrants is to legalize the ones already in the U.S.

Mrs. Pelosi says she, too, is ready to talk legalization but insists Democrats already have solved the immediate crisis at the border by earmarking tens of millions of dollars in the 2019 spending bill to upgrade technology and make asylum seekers feel more welcome.

“There is money there for increased judges to adjudicate the cases more quickly. There’s funding there for humanitarian assistance for the people coming in. There’s money for repairs and some physical necessities that might be there. And there’s funding to send to countries of the Northern Triangle to try to alleviate the problem before it reaches our shores,” Mrs. Pelosi told reporters when she was pestered for a second time in a week over Democrats’ response.

That they are talking about a crisis is a change from just a few months ago when, battling President Trump’s border wall plans, Democrats insisted the numbers weren’t bad compared with the worst years of the 1990s and 2000s.

March’s total of more than 100,000 illegal immigrants nabbed at the border — and predictions of as many as 150,000 this month — have changed that.

Yet what is absent from Democrats’ suggestions is any overlap with Mr. Trump, for whom the crisis is all about the border.

The president and his supporters say they want to stop the crisis either by persuading people to stay in their home countries or, if they do make the dangerous journey north, preventing migrants from gaining a foothold in the U.S.

Efforts to tighten asylum standards or make migrants remain in Mexico while their cases are heard have hit roadblocks in the courts, though, so the president has demanded that Congress step in.

Sen. Lindsey Graham, South Carolina Republican, said this weekend that he would write legislation to deal with loopholes that serve to deliver footholds to illegal immigrants. One prominent target is the 2015 update to the Flores court settlement, which makes it nearly impossible to deport illegal immigrant families.

But Mr. Trump’s definition of a loophole is what immigrant rights activists are defining as a critical safeguard for people fleeing persecution and even death in their home countries.

“He thinks these are all a bunch of bad people trying to game the system to take advantage of us,” said Frank Sharry, executive director of America’s Voice. “What he doesn’t understand is that the push factors are more powerful than the pull factors, and the strategy needs to go beyond the border.”

Mr. Sharry said Republican solutions boil down to making it harder to claim asylum, easier to deport children and permissible to detain families longer.

“They think if we only had more authority we would be tougher and we would be more effective. The fact is you can’t solve this at the border alone, and he can’t take his gaze off the border,” he said.

The scope of the situation is clear.

About two-thirds of the illegal immigrants caught by the Border Patrol last month were children and families, almost all of them from Central American countries.

Under current law, the children have to be turned over to social workers, who quickly place them with sponsors — most of the time family members already in the U.S. illegally. Meanwhile, many of the families demand asylum and, under the Flores settlement, are quickly released from detention and disappear into the shadows.

Of those illegal immigrant children and families who came to the U.S. in 2017, more than 98% were still in the country at the beginning of this year, Homeland Security officials say.

During the last surge of families, in 2014 and 2015, the Obama administration bought thousands of detention beds and detained the families. Illegal immigrants in detention have their cases heard quickly. When they started getting deported, that earlier surge dried up.

Thanks to the Flores decision, detaining families is now more difficult. Nondetained migrants’ cases can drag on for years, which explains why most of those who arrived in 2017 are still in the U.S.

Mr. Sanders, asked about the matter in a Fox News town hall Monday, said the solution now is speed.

“You need to have many, many more judges to expedite the process,” he said.

That’s not going to work on its own, counters Mark Krikorian, executive director at the Center for Immigration Studies. He said it doesn’t matter how fast judges make their decisions unless U.S. Immigration and Customs Enforcement is ready to deport them.

Right now, that’s not the case, he said.

“There needs to be at least a temporary change in priorities so that such failed Central American asylum applicants are searched out and removed as quickly as possible,” he said.

Democrats, though, have resisted giving ICE any more money. Rep. Alexandria Ocasio-Cortez, a bellwether Democrat from New York, complicated the picture this week when she renewed her call for ICE to be shut down entirely.

“I don’t think that agency can be reformed. I think it has to be abolished, and I think we figure out a new way of doing things,” she said.

Rep. Bennie G. Thompson, Mississippi Democrat and chairman of the House Homeland Security Committee, has ruled out abolishing ICE as an option.

Instead, he and Rep. Jerrold Nadler, New York Democrat and chairman of the Judiciary Committee, released a list of solutions this month that avoided the border. They said the answers lie in nation-building in Central America to prevent people from fleeing their homes, and shifting resources to be more welcoming in the U.S.

They called Mr. Trump’s get-tough approach “ill-advised.”

Mr. Krikorian called their outline “a PR document, not an actual solution.” He said aid to Central America, even if it does work, won’t make a dent for years to come. He also said Mr. Sanders‘ and Mr. Ryan’s solution of legalization won’t solve illegal immigration, but is rather an attempt to define the problem away.

About the only area of agreement is that neither side trusts the other to negotiate.

“It’s so clear this is all about 2020 and not a solution now. The chaos serves Trump,” Mr. Sharry said. “We don’t have any illusions that this is a normal policymaking process heading towards a deal. You have a president worried about his brand and his reelection.”

Mr. Krikorian, meanwhile, said the solutions are apparent, but Democrats like Ms. Ocasio-Cortez and the presidential hopefuls aren’t going to be able to touch them.

“This is not going to change until some things are done that the Democrats cannot bring themselves to do,” he said. Their proposal is inadequate as a matter of policy, and I think it’s inadequate as a matter of politics. But I don’t see any way today’s Democratic Party can say any more. And I think they’re going to pay a price for it next year.”

⦁ Bailey Vogt contributed to this article.