You may yawn at the thought of yet another movie dealing with illegal immigration, but although “Sin Nombre” ends up at the Rio Grande, it takes an unusual route in getting there. It also happens to be exceptionally well made, avoiding both the cliches and the mawkishness that can so easily seep into such stories.

The script by newcomer writer-director Cary Joji Fukunaga (who’s benefited from labs at Sundance) starts in Chiapas, where we meet Willy, aka Casper (Edgar Flores), a member—more sensitive than most—of the powerful Mara gang headed by Lil’ Mago (Tenoch Huerta Mejia), a lanky, heavily tattooed and, as it turns out, nasty paterfamilias. Casper is initiating young Smiley (Kristyan Ferrer) into the gang—a process that will include the boy’s not only being brutally beaten by his “comrades” but also killing a captured member of a rival group—but is also skating on thin ice by sneaking off to date a sweet young thing named Martha Marlene (Diane Garcia) from another region.

Meanwhile, a Honduran girl named Sayra (Paulina Gaitan), who’s been living with relatives, is forced to join her father, recently returned from the United States, and his brother in trying to make their way through Guatemala and Mexico to the U.S. border. The trek involves traveling by foot through the jungle until they reach the railway, where they’ll clamber atop freight cars along with hundreds of others to make a journey through areas frequently filled with hostile populations, government military forces and dangerous thieves.

The two plot strands come together when Lil’ Mago, who’s already found out about his dalliance with Martha and ended the relationship brutally, compels Casper—as well as Smiley—to accompany him in robbing the train. When Mago threatens Sayra, Casper comes to her defense, and afterward must join the travelers while sending Smiley back home. Unfortunately, his act mobilizes the entire gang, which has a network of cells throughout Mexico, to track him down and, shall we say, terminate with extreme prejudice. Of course, Sayra is drawn to him, and before long they’re on the run together.

One can imagine this scenario being slicked up into something very mainstream. But Fukunaga opts instead for grit and a sense of somber authenticity. True, he goes for the heartstrings with the Casper-Sayra story (which hearkens back to “Romeo and Juliet,” though perhaps “West Side Story” is a better comparison—and you know what that means for the ending), and Flores and Gaitan could certainly have a harder edge. But the material surrounding the gang—the beatings, the casual violence, the obsessive lust for revenge—is wrenchingly real (Mejia is genuinely scary), and within it the story of Smiley carries a powerful punch. So too does the “road” (or “railway”) segment of the picture, which points up the attitude of many Mexicans to illegals from outside their borders, shown most directly in a scene in which the passengers atop the train are pelted with rocks by youngsters as they pass (a contrast with an earlier sequence in which locals tossed them food). The script also brings sad surprises, as in the fate of Sayra’s father, which is treated with matter-of-factness when it might have invited bathos.

“Sin Nombre” is shot in widescreen by Adriano Goldman without undue virtuosity but with a real sense of place, and the editing by Luis Carballar and Craig McKay happily avoids the rat-a-rat hyperkinetic style that’s become so commonplace in films from Latin and South America in recent years, preferring a more subdued, realistic approach. Marcelo Zarvos’ score complements nicely, avoiding cliches in favor of something richer and more sophisticated.

Yes, “Sin Nombre” is about desperate people trying to make their way across the border into the United States. But if you think you’ve seen it before, you’re mistaken.

Incidentally, the title, “Nameless,” refers to crosses set up for unidentified people who die in trying to cross the border—and by extension all those who do so.