Japanese companies established Thailand’s auto industry virtually from scratch, dating back to the years after World War II. By the late 1970s, Japanese brands commanded around 90 percent of car sales in Thailand. They invested in building Thai supply chains, and their cars were also widely perceived by customers as reliable.

In the 1990s, American and South Korean automakers targeted the Thai market but barely made a dent in Japan’s share.

Now Japanese automakers’ stronghold is finally being loosened by Chinese manufacturers that offer something they don’t: electric vehicles at affordable prices. The influx of Chinese brands like BYD, Great Wall Motor and SAIC Motor in the past two years is ringing alarms in Japan.

In December, Srettha Thavisin, Thailand’s prime minister, traveled to Japan with a message for Japanese companies: Move quickly, invest in electric vehicles or lose out to China.

“You are not alone in the world,” Mr. Thavisin warned Japan’s automakers in an interview with Japanese media.

Japanese companies’ unwillingness to fully embrace electric vehicles, which are popular in Thailand, has held them back in the Thai market. Mazda, Mitsubishi, Nissan, Suzuki and Isuzu have taken the heaviest blows, in part because of their limited lineups of plug-in hybrid or fully electric models. Last year, new car sales in Thailand for those companies collectively dropped 25 percent while overall sales fell 9 percent, according to data compiled by MarkLines, an automotive information provider.