America's railway system is hidden. Few Americans know that you can travel around the whole country by rail without hopping like a hobo on to freight trains.

And, what's more, it can be fun. This is a great way to see America, even if at times there are longueurs through the more desolate parts of the west, and Amtrak, the state-owned passenger train company, is rather like a poor version of British Rail circa 1970.

Penn Station in New York, where my journey started, is typical of the way that the railways have been hidden in America. The station is a subterranean maze, connecting various subway and suburban lines to long-distance services, but there is now barely any trace of railway use on the surface. Indeed, from the subway, you descend to take the trains.

My aim was to travel around America by rail in less than two weeks. The schedule was hectic but do-able, provided I escaped the legendary hold-ups, when priority is given to the freight companies which own most of the tracks. I could have started with an overnight trip straight to Chicago, but instead went via Pittsburgh on a day train so that I could see a bit of the Pennsylvania countryside – and save quite a lot of money because the direct route was a couple of hundred dollars more expensive.

This is one of the complexities of using American passenger trains. Amtrak is confused about whether it is an airline or a train company. There is no standard fare: the price is dependent on how many tickets have already been sold for a particular service and reservations are mandatory. So, there is no such thing as a simple train fare between A and B. Book late and you will pay through the nose.

Also, passengers are not allowed on to the platforms – tracks as they call them – until 10 minutes before departure for security reasons. This is a blessing, since the platforms are generally narrow concrete strips with no kiosks or coffee machines, let alone any seats. Then, you are required to sign your ticket and make yourself known to the guard, who bizarrely issues you with another ticket, which is placed in a little tab above your seat.

Even more strangely, you must carry ID. Then there is the terror of terrorists. Security announcements are so frequent at the stations that it seems Amtrak wants to create an impression of a country at war.

For this first leg, I travelled business class, where the seats are exactly the same as in coach class and the only advantage seems to be that there is free coffee and tea at the snack bar. From the Hades of Penn Station and the industrial decay of the shoreline, the train soon emerged into the fields and suburbs of New Jersey. Here again, there is fear – this time of speed. The conductor warns breezily that the train might go as fast as 100mph and people should be careful moving round the train. For the most part, it travels far more slowly, perhaps 60mph at best, and the seats are all set backward as if in preparation for a collision. In fact, that is because at Philadelphia, 80 minutes down the line, the train is reversed.

This takes for ever, and the lights go out as the traction is changed from electric to diesel. It gave me time to buy a Chinese meal at the superb 1930s' Philadelphia 30th Street station, with its vaulted roof, which, apparently, is reinforced so that a small airplane can land on it, a rare example of integrated transport in the US but one that, I suspect, is rarely used.

Leaving Philadelphia, the scenery becomes decidedly more interesting, with huge rivers emerging from the hills and the autumn colours lighting up the forests through the Allegheny Mountains. Soon, though, the colours were lost in the gloom of the evening and we reached Pittsburgh.

I had bought sleeping-car accommodation and, after a four-hour wait for my next train, which was half an hour late, I was allocated what must be the smallest room ever rented out. The Amtrak compartments vary slightly from train to train, but the one on The Pennsylvanian spares only a foot of space on the door side of the bed (which folds out into two facing armchairs during the day). In American style, the bed is lengthways, parallel to the tracks which, provides a far better night's sleep because you are not unconsciously bracing yourself against acceleration or braking.

Yet these compartments are bliss – I lay in bed watching the skyscrapers of Pittsburgh disappear in the night. During the day, I could watch the world go by from the upper deck of the huge carriages, far larger than anything in the UK because the height of bridges and tunnels on American railways is much greater.

Chicago, reached in mid morning, is the railway capital of America. Even at the height of the nation's dependence on trains, passengers had to change to reach California and any other points west from here. There were barely any coast-to-coast direct services then and there are none now. In an act of devilment, Chicago Union Station has two sections, one facing east, the other west. The tracks are barely 100 yards apart and therefore could easily be joined, but aren't.

There are trains to LA and San Francisco from Chicago, but I chose the Empire Builder to Seattle, a journey of nearly two days that promised good scenery but delivered little thanks to Amtrak's ill-thought out scheduling. Because the train leaves Chicago at 2.15pm, it crosses the dull Wisconsin fields during the remainder of the day, reaching the banks of the Mississippi just as darkness falls.

The next day was even worse. Dawn broke over the Montana plains. Nearly all of it is the same dull savannah, except the western section, the start of the Rockies, which we reached as the sun was setting, giving just a few tantalising glimpses of the mountains.

A word here about Amtrak's stopping policy, which gets countless people into trouble. The train staff tell you not to get off except at designated smoking stops, and then they warn you not to leave the platform, never informing you when the train will leave. Of course, after the train has had lengthy stops with people sticking obediently next to the train, they go a'wandering, only to find the train departing without them. Sometimes the driver sounds a warning on the horn, but more often they don't.

After sleeping through the Rockies, there were exciting views of the Cascades for a couple of hours before we reached Seattle, more than an hour early – the timetable is another example of where Amtrak is economical with the truth. The next leg of my journey, on the Coast Starlight, took me to Los Angeles on a 36-hour journey. Leaving Seattle, the train rounds the Puget Sound and then trundles through the pleasant, if not spectacular, foothills of the Cascades. Imperceptibly, the train climbed, so that by dinner time we found ourselves in the first snowstorm of winter at Chemult, Oregon, 5,000ft above sea level. This train has the additional luxury of a parlour car, with armchairs and wide windows.

The next day was to be by far the most scenic of the trip, starting on the wetlands of the Sacramento Valley, which are dotted with houses on stilts and waterways winding through the marsh grass, and ending on the spectacular cliff-lined coast between San Luis Obispo and Santa Barbara. As we finished breakfast, we arrived at Martinez, where big abandoned navy ships, tucked away in one of the northern inlets of the bay, suddenly emerged above the marshes.

The train never reaches San Francisco because it is on the wrong side of the Bay, but stops instead at the station in Oakland from where there are connecting buses to the city. The train proceeds through California's back country, which looks at times so parched that one wonders how it is so fertile. It seems we are on the San Andreas fault, which is why there is no vegetation on parts of the hills.

As we approach San Luis Obispo, the journey becomes dramatic, the train sweeping around a huge horseshoe bend hugging the hillside above the highway. After San Luis Obispo, we ride along the ocean for an hour, with long surf tumbling on deserted beaches ringed by sandstone cliffs, lit up by the orange sun fading over the ocean and the outlying islands. We pass the Vandenberg military base, where, until 15 years ago, the trains were stopped, the curtains on the base-side closed, and military police were put in each carriage to make sure no one looked out of the windows.

We reach LA, where at lunchtime the next day I boarded the Sunset Limited for an epic two-day trip to New Orleans. One of the nicest aspects of Amtrak is that it makes people sit together to eat, filling up the little tables of four, irrespective of demand. This being America, you are forced to engage with your neighbours, and they tend to be interesting, different from other Americans simply by being on trains. Amtrak is not really a public transport system, more a tour company for the relatively well-heeled and adventurous. The people on the trains, therefore, fall into two categories, those who fear flying and, the majority, the ones who are taking a trip, often for the first – and quite possibly last – time because they like the idea of trains.

We went to bed just into New Mexico, and woke in Texas, which took until breakfast the following day to cross. After El Paso, there was nothing for the rest of the daylight hours except scrub desert, yet broken up with hills and the occasional river. We go along the Rio Grande for several miles, which proves to be not at all grand, and finally reach Louisiana at breakfast time, crawling through the southern wetlands to reach New Orleans by early afternoon.

From New Orleans to New York, on the oddly named Crescent, it's another 36-hour ride, this time through surprisingly attractive countryside. In the south, the forest is dense and rich, but the settlements are sparse and poor as we peek into backyards full of junk. After a night through Georgia and South Carolina, we emerge in Virginia with its old-style towns and homely grocery stores. Then it's the industrial heartland from Washington via Philadelphia to New York's Penn Station.

The trip, without stopovers, could be undertaken in nine days, but more sensibly could be done in a fortnight and provide a far more thorough impression of America and its people than any comparable car trip. And be far less tiring. Amtrak's foibles are, at times, intensely irritating, but the train still takes most of the strain.

Christian Wolmar is a writer and broadcaster specialising in transport. His latest book is Engines of War: How Wars Were Won & Lost on the Railways (Atlantic Books, £20)

Compact Facts

How to get there