JIT HAS taken more than a quarter of a century, but on January 9th for the first time passengers travelled the full length of a 22km (14-mile) elevated railway line from the poor southern suburb of Villa El Salvador to the centre of Lima, Peru’s capital. The metro line is the first in this city of more than 8m people. Its vicissitudes mirror those of the country.

The project began in 1986 with a loan deal between Alan García, in his first term as Peru’s president, and Italy’s prime minister Bettino Craxi. It halted again after three years, 9km and more than $200m, amid claims of rake-offs in both countries. Economic depression and political instability meant that for years the line’s unfinished cement pylons served only for graffiti artists.

In 2006 Mr García returned to power. With a loan of $300m from the Andean Development Corporation work on the “electric train”, as Peruvians call it, began again. The line has begun operating with just five (Italian) trains, running at 20-minute intervals. Another 19 trains, from France’s Alstom, are due in 2013. Work has begun to extend the line by another 12km to north-eastern suburbs.

Late and expensive though it is, the metro is welcome. Lima has one of the worst public-transport systems among Latin American capitals, featuring tens of thousands of privately owned minibuses. The result is gridlock, pollution and frequent accidents.

Luis Castañeda, the city’s mayor from 2003 to 2010, built a 26km bus rapid-transit line through the heart of Lima. His successor, Susana Villarán, has promised to move ahead with further metro lines (there are plans for four more). Traffic congestion makes the average commute in Lima over an hour each way and costs more than $1 billion a year in lost output and health problems caused by pollution, according to Antonio Brack, a former environment minister.

The city needs a debate about whether to favour bus rapid-transit systems, or more expensive but faster and higher-capacity metro lines. Unfortunately it is not likely to get one. The unpopular, but honest, Ms Villarán must instead devote her energies to fighting an effort by her opponents to organise a recall referendum to unseat her in September.