Industrialization drains magic by severing belief-infrastructure
Magic in the story works like an ecosystem: it depends on the old landscape and the practices built around it. When railways, telegraph lines and machinery replace that landscape, the power leaks away. No one has to fight it. It is starved out by a new order that simply makes it irrelevant.