After years of delay, the federal government says it has developed a way to reliably track foreigners when they depart the U.S., at least by airplane, and plans to install cameras that would photograph all passengers just before they board international flights.

But there’s a big hitch: The government wants airlines to operate the cameras, saying the cost would be “astronomical” if border agents had to staff every international departure gate. Airline officials argue this is a national security function that should be shouldered...