TAPACHULA, Mexico—A Mexican immigration officer clad in white shirt and khaki trousers stops a minibus, opens the sliding door and peers inside. Several federal policemen stand by, watching the improvised checkpoint.

Moments later, two illegal immigrants leave the minibus visibly annoyed. One is from Honduras, the other from Guatemala.

“Mexico...