The rules are simple. If a mudslide hits the BNSF Railway mainline between Seattle and Everett, passenger trains have to stop rolling for 48 hours, providing there are no additional slides within that window.

It's done for safety reasons. Gus Melonas of BNSF Railway says while freight traffic is still allowed to move when passenger trains do not, that only comes after the unstable slope has been inspected by geo-techs. And then those freight trains only move at restricted speeds.

Sound Transit's Sounder commuter trains, along with regional Amtrak Cascades trains and even long distance trains such as the Empire Builder to Chicago, all depend on this stretch of track running just above what can be the choppy waters of Puget Sound, with bluffs often rising at steep angles to the East. During cancellations, Sound Transit and Amtrak have to resort to charter buses, which then add to traffic pressure on I-5.

This week on tracks running below steep bluffs and past the Port of Everett, a railroad pile driver is pounding away, driving 30 foot steel beams 20 feet into the ground. Between the beams go precast concrete slabs. Together, they're designed to keep a notorious slope under control. The railroad knows the slope will still slide, but these so-called "catchment" walls keep the slide - along with trees, boulders and other debris they bring down - from hitting trains and derailing them or landing onto the tracks, only to be hit by trains, another derailment hazard.

Part of this wall was put in last fall; another 600 feet will be going in over the next several weeks.

After that, a 1,000-foot wall will go up along the mainline into Mukilteo., a two million dollar project funded by Washington State transportation dollars. So far, the state has spent 16 million on these walls to support passenger train reliability. BNSF says it's spending millions on its own on maintenance, debris removal, drainage and other expenses. Previous projects in Seattle had been funded by the railroad itself, according to Melonas.

This battle against erosion has been going on for well over a century after BNSF predecessor lines pushed west. But as the region's population grows, so do the number of people riding public transportation, from heavy commuter and medium distance trains such as the Amtrak Cascades to the region's growing light rail system and expanding bus routes.

"It's paying dividends," said Melonas. "Last year if they weren't in place, we would have possibly 75 percent more slides that would have impacted the roadbed."

Sound Transit numbers seem to bear that out. The agency tells KING 5 that over the winter of 2012/2013, 206 trains were canceled due to multiple slides hitting the tracks. Over last winter, 2016/2017, the number of canceled trains dropped to just six, and that year saw record rains into the late spring.