Montana lawmakers gave final passage Friday to a bill banning the social media app TikTok from operating in the state, a move that’s bound to face legal challenges but also serve as a testing ground for the TikTok-free America many national lawmakers have envisioned.