Facebook, Google, Snapchat and Pinterest have been unable to vanquish TikTok. Now their investors may be a bit too hopeful that the U.S. government will do it for them. 

Stocks of the parent companies of TikTok’s main U.S. rivals jumped Thursday as Shou Zi Chew —Chief Executive Officer of the red-hot social media app—was grilled before Congress over a host of issues that are mostly related to the company’s Chinese ownership. Mr. Chew’s appearance before the House Energy and Commerce Committee came after the Biden administration threatened earlier this month to ban the app if the company’s Chinese owners didn’t divest their ownership stakes. 

The Chinese government responded Thursday, saying it would oppose any forced sale on the grounds that it would involve exporting technology that would require government approval. That appeared to raise the odds of an outright ban, which would come as good news to the social media and online advertising giants that have ceded market share to TikTok over the last couple of years as the app has exploded in popularity, now reaching more than 150 million active users in the U.S. 

Thursday’s hearing was further evidence that a social app purportedly used by nearly half the U.S. population doesn’t have any friends in Washington. Committee members from both political parties roundly voiced concerns about TikTok’s Chinese ownership and expressed strong skepticism of the company’s stated plan to hive off data on U.S. users with the help of Oracle Corp.

“Your platform should be banned,” said Rep. Cathy McMorris Rodgers, the committee’s Republican chair. “I still believe that the Beijing communist government will still control and have the ability to influence what you do,” said Rep. Frank Pallone of New Jersey, the panel’s top Democrat. 

Facebook-parent Meta Platforms Inc., Snapchat parent Snap Inc. Google-parent Alphabet Inc. and Pinterest have seen their stocks average a 10% gain since March 15, when The Wall Street Journal reported the threat from the Biden administration. That is more than twice the Nasdaq Composite’s gains in that time. Together with Amazon, those companies generated more than $380 billion in online advertising revenue last year. 

But that was up only 6% from the previous year—a notable slump from the 28% annual growth averaged over the previous five years. So the prospect of having a formidable competitor being taken out of circulation is heartening, especially in a market that isn’t expected to turn back up anytime soon.

Bernstein analyst Mark Shmulik estimates that TikTok is on track to generate between $7 billion and $8 billion in revenue in the U.S. alone next year. He named Meta and Alphabet, which also owns TikTok competitor YouTube, as the companies most likely to benefit from a TikTok ban, but added that “some ad dollars may just go back into ad buyer pockets or look for an experimental platform outside our cohort.” 

Experienced DC watchers say it is still far from certain whether such a ban can even be enacted—and if it will stick. “We remain below 50% that TikTok is ultimately banned in the U.S.,” wrote Paul Gallant, policy analyst for TD Cowen, in a report Wednesday. Matt Perault

of New Street Research notes that TikTok could challenge any ban on First Amendment grounds, which would result in a lengthy court battle at the very least.

Mr. Chew may have gotten buried by political grandstanding on Thursday. But for investors, it is still too early to be dancing on TikTok’s grave.

Write to Dan Gallagher at dan.gallagher@wsj.com