NEW DELHI — Anil Gujjar arrived in India’s capital from a small village in the northwestern state of Rajasthan carrying nothing except a backpack and hopes of finding a good job.

The odds were not in his favor. In February, India’s railways system announced a national recruitment drive for the most menial positions in its hierarchy — helper, porter, cleaner, gateman, track maintainer, assistant switchman.

Gujjar, the son of a farmer and the first person in his family to attend college, was one of them. At the test center in Delhi where he took a mandatory exam in November, he looked around warily at hundreds of young men like him. Nearly all were college students or graduates. Some even had master’s degrees.

The railways recruitment effort is a potent symbol of India’s employment conundrum. The country is one of the fastest-growing major economies in the world, but it is not generating enough jobs — let alone good jobs — for the increasingly educated young people entering the labor force.

By 2021, the number of people in India between the ages of 15 and 34 is expected to reach 480 million. They have higher levels of literacy and are staying in school longer than any previous generation of Indians. The youth surge represents an opportunity for this country of 1.3 billion, economists say, but only if such young people can find productive work.

Recent employment trends are not encouraging. An analysis of government data by Azim Premji University showed that unemployment rose in nearly all Indian states between 2011 and 2016. Jobless rates for young people and those with higher educational qualifications increased during the same period, in some cases sharply: The unemployment rate for college graduates jumped from 4.1 percent to 8.4 percent, according to Santosh Mehrotra, a well-known labor economist.

The fate of India’s millions of job-seekers represents a major political liability for Prime Minister Narendra Modi as he seeks reelection this year. Modi came to power almost five years ago promising “development for all” and robust job creation. But his attempts to increase manufacturng and entrepreneurship have not succeeded in turbocharging employment.

Meanwhile, Modi’s controversial move in late 2016 to ­invalidate most of India’s bank notes — ostensibly to stem corruption — had a deleterious impact on workers. About 3 million jobs were lost in the first four months of 2017, according to the Center for Monitoring Indian Economy, a research firm in Mumbai that conducts a national employment survey. Its data also showed that the Indian labor force shrank between 2017 and 2018 — not a sign of a healthy job market.

“India is rapidly losing an opportunity,” said Mahesh Vyas, the chief executive of the research firm. “We’re just arguing needlessly and endlessly rather than deploying all these young people coming into the labor market into productive work.” The result is a “slow and insidious crisis,” he said.

For many young Indian people, finding a job is an all-consuming task. An entire industry has sprung up offering “personality development” classes — a combination of basic English, social skills and interview preparation advertised as improving employability. Job scams are common, with fraudsters preying on the aspirations of those seeking work.

Educated youths do not want to be “pakora wallahs” — people who make a quintessential fried Indian snack — said Radhicka Kapoor, an economist at the Indian Council for Research on International Economic Relations. “They want good, productive jobs, and they’re going to wait it out until they in fact find these jobs.”

Ajit Ghose, an economist at the Institute for Human Development in Delhi, says that India needs to generate jobs not only for fresh entrants to the workforce — who number 6 million to 8 million a year, according to his estimate — but also for people, mostly women, who are working far less than they would be if they could get stable jobs that paid a decent wage. Ghose has calculated that India has at least 104 million such “surplus” workers.

That’s a monumental challenge for any government — and one that India’s leadership is not meeting. Judging the Modi government’s track record on job creation is complicated by the fact that it has not released any comprehensive nationwide employment data since 2016. The Labor and Statistics ministries have conducted more-recent employment surveys of Indian households, but those results have not been made public.

“It’s anybody’s guess whether we’ll see any employment statistics come out before the 2019 elections,” said Amit Basole, an economist at Azim Premji University.

Arvind Panagariya, an economist who served under the current government as vice chair of its policy planning agency, argued that no real assessment of the employment situation is possible until new nationwide data is released by the Statistics Ministry. Meanwhile, he said, his sense was that concerns about job creation are “overblown,” given India’s high rates of economic growth.

For India’s educated youths, searching for a job that meets their aspirations can feel like a marathon. At the test center in Delhi, waves of applicants for the railway positions arrived three times a day, each weekday, from September through mid-December — a scene replicated at hundreds of exam centers across the country.

The flow of test-takers was so large and consistent that it created its own miniature economy. One entrepreneur operated a makeshift storage locker out of a nearby parked truck. Since the applicants could not take anything inside the exam center, he kept backpacks and phones for a fee of 50 rupees (70 cents). A vendor sold tube socks and ear buds on the sidewalk.

The railway jobs on offer — sometimes referred to as Group D positions — are junior but offer security and a comparatively good salary. The starting pay is 18,000 rupees ($250) a month, plus there are perks such as free train travel.

The stories of the young men — and they were all men, with one exception, at a test center in Delhi over two days — are striking in their sameness. The applicants are mostly college students and college graduates from the northern Indian states of Uttar Pradesh and Rajasthan who are seeking a way out of the villages where they grew up. There are no jobs there, they said.

Gujjar arrived in Delhi for the first time in his life the evening before his 9 a.m. exam. He spent the night sleeping on a sheet that he spread on the floor of the railway station. Early the next morning, he took a bus to the exam center, where he stood, waiting, in a thin striped sweater, arms crossed against the predawn chill. At 7:35 a.m., a guard carrying a portable loudspeaker began barking instructions to the assembled test-takers.

Too anxious for chitchat, ­Gujjar declined to describe how he felt at that moment. “Ask me after I see the exam paper,” he said. The posts at Indian Railways held no inherent appeal, he explained. “It’s not about interest,” he said. “I just want a job.”

Gujjar, 19, helps his parents farm a small plot of land where they grow wheat and millet. A year ago, he tried to join the Indian army, but he did not make the cut in a qualifying exam. There are no opportunities in his village in the district of ­Jhunjhunu, he said, and most of his friends do not have steady work.

After taking the 90-minute computerized test, Gujjar strode through a blue metal gate with a smile of relief on his face. The exam was not as difficult as he had feared. It will be months before he knows whether he has beaten the odds, which are roughly 1 in 300. “If I get a job, it will be worth it,” he said.

Passengers wait to board at a railway station in Amritsar, India, last month. (Raminder Pal Singh/EPA-EFE/Shutterstock)