IN THE middle of the 2006 James Bond film "Casino Royale" we see a sleek, modern, high-speed train taking 007 to the next part of his adventure. On screen we are told where we are: Montenegro. When the film was shown in Balkan cinemas, audiences simply exploded with laughter. Today, if you tell people that you are taking a train they either just look puzzled as to why you should do such an odd thing, or they fuss about your security, trying to convince you that to take the train is to dice with death.

In Albania people look at me blankly when I tell them I am going to take the train from Tirana to Shkoder in the north. I soon understood that most of my friends did not even realise that Albanian railways still existed. Before the fall of communism in Albania there were no private cars or buses, and so virtually the only way to get around was by train. Then, 20 years ago, the vast majority of Albanians simply stopped taking trains and never thought about them again.

They do still exist. But Tirana railway station can hardly be described as bustling. It has only one kiosk selling tickets, and two quiet platforms. Before my trip I arranged to meet some railway officials. As we walked to their office I asked them why many of the railway-carriage windows seemed to have bullet holes in them. They replied that in some areas, children pelted the carriages with rocks. Whether they were egged on to do so—paid by the owners of private coach and mini-bus companies, aiming to scare people off the trains—they could not say.

According to Gramos Gjikolli, the infrastructure manager of Albanian railways, the first trains appeared in Albania as early as 1890 and over the next half century several small networks were built, either for mines or military purposes. But it was only with the arrival of the communists that the modern network was constructed. Today there are 425 kilometres of track and Mr Gjikolli is eager to tell me the story of the rise and fall of Albanian railways.

The period between 1975 and 1989 was the golden age. The trains carried 60% of all passenger traffic. Now that figure is less than 1%. In 1989 the trains carried 10.5m passengers but last year that number was 650,000. In 1989 the railways carried 25,000 tonnes of freight a day but in 2009 they were carrying barely 25-30,000 tonnes a month. In 1989 the railways employed more than 8,000 people. That figure now stands at 1,720, and 95% of them are on the minimum wage, which amounts to €123 ($159).

What strikes me about Mr Gjikolli and his colleagues is their dedication, despite everything. Last year the railways had an income of €9m, of which €5m came straight from the government. The rest was from freight and renting out railway premises. I ask how much comes from selling tickets and we do a quick back-of-an-envelope calculation. The answer is €346,153. We are like firemen, lament the assembled managers. All they can do they say, is sprint around fixing everything that breaks. In theory they have 78 locomotives, but only 18 to 20 actually work, and the rest are cannibalised to keep the others going.

In 2003 Fatos Nano, the then prime minister of Albania, signed a contract worth €74.71m with General Electric to modernise the stretch of railway from Tirana to Durres on the coast and to build a short spur linking Tirana airport to the city. The deal was to end in tears. Deemed far too expensive, the contract was cancelled by the incoming government of Sali Berisha, and became the subject of bitter litigation. In March a US court ordered the Albanians to pay $20.6m in compensation to GE and in May the Albanian authorities announced they would sue the minister of transport responsible for the contract for abuse of power.

The GE project was a railwayman's dream, the managers tell me, but far from being downcast their eyes are now firmly fixed on Brussels. An EU feasibility study has been completed and if the project is approved it could see up to €225m being used to fix much of the network. To these men it is as though they have kept the faith for two decades and now, maybe, salvation is nigh.

My ticket to Shkoder in the north of Albania costs Lek 145, which is 87p ($1.33). The train, which leaves to the minute, has five elderly Italian carriages, which are fullish but not packed. The train is a lot slower than the bus, but it is cheaper. It may also be safer. On Saturday 17th July 14 people died when their bus left the road and fell down a cliff.

I am surprised by the number of black-clad women sporting traditional headgear on board, many of them clutching empty plastic canisters. In the villages beyond Tirana they begin to get off. Every day they come to market to sell their milk.

The trip is sedate, in large measure because the train can only travel at 30-40 kilometres an hour. It takes three and half hours. By road you could do it in half that time. The ticket-collector ladies and I swap fruit. They all have sons and other relatives working abroad. One tells me she has been working on the railways for 27 years and she can't live on the money she earns. I ask her why she does not do something else. She asks me what else she could do. When we get to Shkoder they get on their bikes and wave me off. Their supervisor, who has met the train, walks with me a while to show me how to get to my hotel. I ask him again how and why people work for so little money and he replies simply, as if I should know, that “the railways are their life.”