This episode seems heavily inspired by the book (and now show) American Gods. In that series the old gods have lost a lot of their power because they are no longer worshipped and are fighting the gods of technology. I never finished the book and only watched the first season. But there's a lot of similarities with this episode.