BREIL-SUR-ROYA, France — On a recent sunny Sunday, about a dozen young men, women and children sat around a wooden table belonging to Cédric Herrou, a 37-year-old farmer, laughing about who would cook that night. It could have been any family-like gathering in the pastoral setting high in the French Alps, just above the border with Italy. But it was not.

A local hero to some, a scofflaw to others, Mr. Herrou, who was arrested in August, had helped his guests — all migrants from Africa — to cross the border into France illegally. He planned to sneak them to a train station so they could continue their journey. Some might stay in France, but most wanted to get to Britain or Germany.

Early the next morning, cool and foggy in the mountains, Mr. Herrou and some volunteers in his underground railroad traded tips on which Riviera train station would be best to slip through.

Antibes? Cannes? “Have you ever seen the cops at that one?” he asked an assistant. “There are cops at all the tollgates,” another piped up. Still, they had to try.