– If he had hopped on a plane, Johan Hilm would have gotten from Sweden to Austria in two hours.

Instead, the lanky Swede made an epic overland journey by rail, bus and ferry that took more than 30 hours.

He joined a growing crowd of Europeans who are spurning air travel this summer out of concern for the environment.

Budget airlines such as Ireland’s Ryanair and British easyJet revolutionized European travel two decades ago, when they first started offering to scoot people across the continent for as little as $20 a flight. But that mode of travel, once celebrated as an opening of the world, is now being recognized for its contribution to global problems.

Tourists have been spooked by the realization that one passenger’s share of the exhaust from a single flight can cancel out a year’s worth of Earth-friendly efforts. And so they are digging out their parents’ yellowing Europe-by-rail guidebooks and trading tips on the most convenient night train to Vienna.

Mark Smith, founder of Seat 61, a popular website dedicated to train-based travel around Europe and beyond, said he has noticed a change in the people coming to his site. When he set it up in 2001, users told him they loved trains, or were scared of flying or couldn’t fly.

“Now, when people tell me why they are taking the train, they say two things in the same breath: They say they are fed up with the stress of flying, and they want to cut their carbon footprint,” Smith said.

So far, the biggest shift has been in green-conscious Sweden, where airline executives blame increased train travel — up one-third this summer compared with a year ago — for a drop in air passenger traffic.

Swedish leaders this month announced they would inject new cash into the national rail company. They plan to build up a new fleet of trains after years of cutbacks when cheap plane tickets were luring people into the skies.

The newly coined concept of flygskam, or “flight shame,” has turned some Swedes bashful about their globe-trotting. A guerrilla campaign used Instagram to tally the planet-busting travels of top Swedish celebrities. Next door in Norway, meanwhile, the prime minister felt the need to assure citizens that they need not apologize for flying to see family in the high north.

Hilm, 31, a health care consultant who was on his way to hike across Austria for eight days, said he tried to live an environmentally responsible life. “I don’t drive a car. I eat mostly vegetarian. I live in an apartment, not a big house.”

He was stunned when he assessed the impact of his flights. “I did one of those calculators … online,” he said, “and 80% of my emissions were from travel.”

“I don’t want to say I’ll never fly again, but I do want to be conscious about the decisions I make,” Hilm added over coffee in the Stockholm-to-Copenhagen train’s bistro car. Little kids bounced on the squishy red banquette seats nearby. In the passenger compartments, some people dozed, others played card games. Out the window, cows looked up from their fields as the train hurtled through.

Environmentally friendly travel can require a time investment. To get to Austria, Hilm took a 5½-hour train trip to Copenhagen, a 1¾-hour bus to the Danish coast, a 45-minute ferry to Germany, a 90-minute train to Hamburg, an 11-hour night train to southern Germany and a final three-hour train.

He left his Stockholm apartment before 6 a.m. on a Wednesday. He arrived at his Alpine destination after noon the next day.

What was it worth? Measuring carbon dioxide emissions from travel can be an inexact science. One popular online calculator suggested that Hilm’s trip would have led to about 577 pounds of carbon dioxide emissions if he had flown, compared with 118 pounds by rail, a savings of 80%.

In the first six months of 2019, air passenger traffic was down 3.8% in Sweden compared with the previous year. Climate concerns are among several reasons for the downturn, said Jean-Marie Skoglund, an aviation expert at the Swedish Transport Agency. He said a slowing economy, tax changes and an airline bankruptcy were other factors.

Across Europe, air travel still ticked up — by 4.4% — in the first quarter of 2019, according to figures from Airports Council International Europe, an industry group. But for young, green Europeans, saying no to flying is becoming a thing.

The shift has been inspired in part by Greta Thunberg, the 16-year-old Swedish climate campaigner who sparked a worldwide school strike and has been crisscrossing Europe by train as she pressures politicians to do more about the environment. Thunberg has not been on a plane since 2015. This week, she said she would soon travel to the United States — by sailboat.

Record heat this summer and last has also focused attention on climate change and influenced travel plans. Hilm set out on his trip during a heat wave that brought all-time high temperatures to Paris, Britain, Belgium, Finland, Germany, the Netherlands and Norway.

“If you want to reduce your environmental impact, the best thing you can do is to stop flying,” said Susanna Elfors, founder of a Facebook group called Tagsemester, or Train Vacation, that has been credited with helping to spur train travel.

Even some airlines have gotten in on the “fly less” message.

“Think about flying responsibly,” Dutch airline KLM said in an advertisement. Unusually, it suggested considering a different form of transportation: “Could you take the train instead?”