Indian passengers, leaving town after taking a police constable recruitment exam, climb on top an overloaded train at a railway station in Jodhpur, India. (Strdel/AFP/Getty Images)

The future bumped up against the past this month at New Delhi’s main railway station.

Hailing the advent of a bright new era for India’s 161-year-old rail system, officials unveiled the country’s first high-speed train last Thursday, sending it on a test run to Agra, the home of the Taj Mahal, in which it reached a speed of 100 mph.

But the realities of the aging, state-run system threatened to derail the excitement, as other trains ran several hours late and disappointed passengers rolled out their sleeping mats on the floor next to spit-stained walls and trash-strewn tracks.

The twin images embody the challenge facing India’s new prime minister, Narendra Modi, who pledged during his election campaign to modernize the decrepit rail network with new freight corridors and coaches and Japanese-style bullet trains that would crisscross the nation.

The new high-speed train, set to launch officially in November on the New Delhi-Agra route, travels at just half the speed of the superfast trains that Modi wants to build. But that hasn’t stopped “bullet” from becoming a buzzword here. Officials called Thursday’s train a “semi-bullet train,” and station workers fondly dubbed it “Bullet Raja,” or Bullet King.

Passengers sit in the general compartment of a train on a hot summer day in Allahabad, India, Thursday June 19, 2014. Many parts of north India continue to experience hot and humid weather as temperatures hover around 40 degrees Celsius. (Rajesh Kumar Singh/AP)

“This is our first step toward realizing the dream of running bullet trains. It shows we can do it,” said Anurag Sachan, manager of the railway’s Delhi division. “We need political will from the top to overhaul our railways. If China can do it, why can’t we?”

But it may prove an uphill task, even for Modi, the get-tough former chief minister of Gujarat state who has pledged to whip all of India into shape.

India’s railways are a story marked by endemic red tape, neglect, poor infrastructure and populist politics, all combining to generate losses of about $5 billion last year. It took the country nearly 20 years, for example, to increase the speed of its fastest train from 93 to 99 mph. Express trains run at an average speed of 31 mph and freight trains at 15 mph, according to information submitted to Parliament in 2012.

Modi experienced the politics bedeviling India’s railways firsthand last month when he raised train passenger fares by 14 percent, a decision no politician had dared make for a decade. His government said the increase was needed to help stem the system’s staggering losses and improve services. But protests broke out immediately, with demonstrators blocking train tracks and burning Modi in effigy.

The new finance minister, Arun Jaitley, defended the price increase. “India must decide whether it wants a world-class railway or a ramshackled one,” Jaitley said.

In the end, Modi rolled back the jump in fares — but only for city commuter trains.

India’s sprawling rail network has long evoked romantic images of British colonial-era steam locomotives curling through Himalayan towns and extravagant coaches designed for maharajahs. But there is nothing romantic about today’s ailing system, which carries about 23 million passengers a day.

The tracks are poorly maintained and are often covered with trash, coaches need upgrading, only half the signals are automated and safety standards are sloppily observed, rail experts say. There are not enough bridges and overpasses at unmanned railway crossings.

Trespassing, a widespread phenomenon, kills about 15,000 people every year, according to a 2012 rail-safety panel report. In addition, about 3,000 people have died in the past decade in train accidents. In some parts of India, ticketless passengers ride on the roofs of trains, and some are electrocuted or fall off. Efforts to ban rooftop travel have gone nowhere.

Sanitation is also generally poor, with station floors crammed with sleeping passengers, dogs and beggars.

“Politicians keep adding new trains, stations and halts to satisfy their voters, without worrying about the capability of the rail tracks, condition of coaches and financial viability,” said Jai Prakash Batra, a former chairman of the Railway Board.

And it’s not just about passengers. Economists say India’s railway system simply does not meet the needs of an aspiring economic and industrial powerhouse. The total rail length is woefully inadequate today, at a little over 40,000 miles, just 7,400 miles more than the country had when it gained independence from Britain in 1947, Sachan said.

“About two-thirds of freight in India travels on-road because we do not have enough rail tracks,” said Arvind Mahajan, a partner and infrastructure expert at the consultancy KPMG India. “The priority is always given to the passenger trains, so freight trains have to wait. This raises the cost of logistics and makes Indian manufacturing uncompetitive.

“Your goods reach when they reach. There is no guarantee,” Mahajan added. “And you can’t even track your consignment.”

India is building dedicated freight corridors with financial assistance from Japan and the World Bank, but construction is running five years behind schedule, officials say. Such delay is commonplace.

In 2007, the country invited private investors for the first time to build electric and diesel locomotives. Companies including GE and Bombardier bid for the projects, but after seven years a contract has still not been finalized, Batra said.

“It is an archaic organization,” said an official in the Rail Ministry, commenting on the system on the condition of anonymity because he is not authorized to speak to the media. “Instead of decisions, you have endless deliberations. Nobody has the power to make things happen, but everyone can stop work from happening.”

This week, Modi’s government announced that it would upgrade 10 train stations and make them look like airports, introduce high-speed trains on nine routes, and begin work on India’s first bullet train, connecting Mumbai to Modi’s home state of Gujarat.

“Rail is not just a mode of transport; it is an engine of India’s growth,” Modi said in a televised address to the nation Tuesday. “Through the railways, we want to take the country to new heights.”