GELUGOR, Malaysia — The more than 3,000 migrants from Bangladesh and Myanmar who recently landed in Indonesia and Malaysia ended weeks of a nightmare at sea only to fall into an administrative limbo that could last years, even decades.

In a potential breakthrough in a crisis across Southeast Asia, Malaysia and Indonesia agreed last week to shelter the migrants, and thousands more who may still be at sea, on the condition that they be returned home or resettled in third countries within a year.

If the past is any guide, that goal may be hard to attain.

Few countries seem willing to accept the migrants, even those who qualify as refugees deserving asylum; there is already a tremendous backlog of applicants seeking resettlement; and the agencies that deal with them are overwhelmed.