(CNN) — It's close to midnight and Berlin's Hauptbahnhof central station is almost deserted. But on platform five, there are scenes of mild chaos.

The City Night Line sleeper has just pulled in and passengers -- me among them -- are grabbing their luggage and eyeing up the carriages that, for the next eight hours, will be their hotel on wheels.

I've been fascinated by night trains ever since I first took a sleeper from Munich to the Hungarian capital Budapest 20 years ago. Back then such trains were still relatively common sights in European cities not yet in thrall to the budget airline revolution.

Today, it's a different story.

Night services are in decline against the competition of cheap airfares and faster daytime intercity train services. Yet the allure of the trans-European night sleeper, the star of countless literary and film classics from Agatha Christie to James Bond, continues to endure.

So what's it like to travel on today's night sleepers?

The passengers waiting with me at Berlin's main station for the sleeper linking Prague to Oberhausen in western Germany are a mixed group. There's a young couple, just returned from a vacation in Turkey using their rail-and-fly ticket to make a last connection.

A Norwegian family of three, spending a night on the train on their way to Germany's Ruhr region.

There are businessmen in suits with smart leather roller bags, and a group of backpackers playing hacky sack on the platform.

'Relaxed job'

Passengers jostle to board the Prague-Oberhausen sleeper. Kai Mueller

After the train has rolled into the station, passengers jostle past each other with bags and suitcases until everyone has found their seat or compartment.

On City Night Line, travelers have the choice between three comfort categories.

These range from economy or deluxe sleeper compartments, couchette cars for group use or single berths in multiberth compartments, and seated cars with six-seat-compartments or open saloon cars with reclining seats, depending on the route.

Sleeper trains are comprised of different cars from different national operators that are split and recombined at specific stops, making it possible to offer several connections with a relatively small number of cars.

My sleeper compartment is in a Czech car with its own friendly Czech attendant. Further down the train German staff are looking after passengers in the couchette and seated cars.

"It's always a bit chaotic in the beginning, until everyone has found their seats," says Jeannine Kroggel as she welcomes me on board.

Wearing the uniform of German rail company Deutsche Bahn (DB), Kroggel is the supervisor (Gruppenleiter) on my train, looking after both passengers and staff.

"Once everyone is settled in this is actually a pretty relaxed job -- I often find time to look after paperwork between stops."

She's right.

After Kroggel checks my ticket, I hear the doors of the other passengers' compartments closing one after another and a relative quietness descends.

I'm not ready to sleep, and instead walk the length of the train.

Golden age of travel

If you want to ensure a sleeping berth, you have to make a reservation. Kai Mueller

The seated cars are busy, and not everyone seems to have a seat -- the tourist couple from the platform is sitting on the ground, heads resting on their luggage.

"On each sleeper train there are two cars passengers can use without reservation, but we had to lock one of those for safety reasons as the doors are faulty, so unfortunately not everyone will have a seat tonight," Kroggel tells me.

While cheaper -- with prices starting at €40 for the Berlin-Cologne connection via bahn.de -- the seating cars undoubtedly lack the comfort of the cabins with beds.

Part of the appeal of these mobile sleeping quarters is their throwback to a golden age of rail travel.

Sleeper trains have been carrying passengers through European nights for almost 150 years, having been introduced by the Belgian Compagnie Internationale des Wagons-Lits (CIWL) in 1873. Services increased over the decades but were severely disrupted, if not totally halted, during World Wars I and II.

The Cold War and subsequent fall of the Berlin Wall, led to a breakup and then re-merger of Germany's main night train operators. Today, sleeper coaches on DB tracks are operated under the City Night Line brand.

Hotel on wheels

Kroggel has been working on sleeper trains since 2009 and says she's come to appreciate the peculiar life schedule they present her.

"It took me a while to adjust working nights," she says. "But now I'm settled in. I work two nights in a row -- once we arrive at our destination I check into a hotel and then work on the same train back in the evening."

The rhythm of the rails makes everything more relaxed. Kai Mueller

"For example the one we are on, the Prague-Oberhausen connection, arrives at eight in the morning and leaves again at 9 p.m. So I have plenty of time to sleep, chat to my family on the phone and do a bit of shopping or sightseeing if I want to."

She points out the different cars on our train, reflecting the nationalities of the countries they connect.

"I quite enjoy my profession, working with people a lot -- I sometimes think of it as a hotel on wheels. Working on the City Night Line has a proper European feel to it -- just look at the cars that make up this train.

"We have a Polish sleeper traveling between Warsaw and Cologne, a Czech sleeper going between Prague and Oberhausen mixed with our own DB cars. The same goes for the people traveling on the train -- we have everyone, from Americans on a tour of Europe to German backpackers."

City Night Line is the main operator of night trains in central Europe today. The network connects Amsterdam with Munich, Munich with Rome and Prague with Oberhausen.

"The only routes I haven't traveled on yet are Munich-Venice and the one between Loerrach and Hamburg, the car train," Kroggel says. "But they are on the list."

She continues her round, wishing me a good night.

Related content All aboard: Railroad adventures for every budget

I take notes, brush my teeth and clamber into the top bunk. While drifting off to the clack-clack sound of the train, I contemplate the future of such services.

Although a substantial number of European operators continue to offer sleepers, competition from airlines and fast day trains is eroding their popularity.

Last year, Deutsche Bahn canceled both its Berlin-Paris and Berlin-Copenhagen night routes, citing declining passenger numbers. DB said that in 2014 its sleeper lines had turned a loss in the double-digit million euro range.

Eco travel

First-class sleeping cars come with their own shower and WC. Kai Mueller

But the outlook is much more positive than a year ago.

DB has confirmed that no further cuts are planned and the network is being improved to offer a cost-effective and comfortable night train service.

In an increasingly environmentally conscious age, such trains can capitalize on their green appeal -- the majority of DB services use 100% green electricity.

They're not the only ones investing in improved connections.

Two truly European routes have been re-introduced by Russian rail operator RZD: since 2011 it's operated a sleeper from Paris to Moscow once a week, making it the longest direct passenger train in Europe.

Since 2010, another sleeper has linked Moscow with Nice on the French Riviera, following Russian aristocrats traveling the same route between 1864 and 1914.

I wake up to the sun shining through the window, the fields and small towns of western Germany passing by.

The attendant serves coffee and pre-packed Czech breakfast: rolls, jam and cheese.

My train crosses the Rhine before entering Cologne main station underneath the scenic cathedral. I slept well and the whole day lies ahead of me. I decide the night train idea isn't yet outdated.

Traveling through the night is environmentally sustainable, comfortable and a romantic way of getting around Europe. The sleeper train is a proper deceleration express: no airport rush is needed to board it, and instead of sipping overpriced drinks strapped to a seat, passengers can bring their own dinner and breakfast.

The night train remains the budget airline of idlers and romantics. Long may it last.

European night sleeper services

The Thello night train runs daily from Paris to northern Italy. KENZO TRIBOUILLARD/AFP/Getty Images