TOKYO (AP) _ After Tokyo's stock market fell from its dizzying heights in 1989, a few foreign brokerages became the envy of their Japanese competitors by making handsome profits in a prolonged bear market.

Now, even those survivors are faltering amid increasingly fierce competition.

When share prices began falling in early 1990, foreign brokerages like Salomon Brothers brought in expertise and technology developed in other markets to make money with sophisticated trading strategies.

They bought and sold futures, options and more exotic derivatives of stocks and bonds that the Japanese were only becoming familiar with. They used high- speed computers to profit from the age-old technique known as arbitrage, the simultaneous purchase and sale of the same product in different markets.

The foreigners succeeded in expanding their business despite an 80 percent decline in average volume in the Tokyo market and a 50 percent plunge in its main index, the Nikkei Stock Average.

''It was beyond the comprehension of many brokerages how much money could be made,'' says Robert Sasaki, manager of futures trading at Jardine Fleming.

Japanese brokerages, bogged down in financial scandals and suffering from a major economic downturn, are still struggling to catch up.

''It's a double whammy for the Japanese brokerages. They've got to scale down their businesses and at the same time find other kinds of products and services,'' says Bradley Treadwell, business strategist SBCI Securities (Asia) Ltd.

The largest-capitalized foreign brokerage in Japan, Salomon Brothers Asia once made such huge profits from its derivatives trading that many Japanese traders blamed it for wide price swings that were rumored to result from computer programmed arbitrage dealings.

Morgan Stanley, which reportedly has managed to stay on top of the futures market by using high-speed trading systems that keep it a few seconds ahead of the competition, says it has even received bomb threats.

Foreign brokers say they've been made scapegoats for the stock market's underlying structural problems, such as price-earnings ratios far out of line with the London and New York markets. They say the market is growing increasingly inhospitable.

The Ministry of Finance has sought to curtail derivatives trading by raising commission fees and shortening trading hours. There is also talk of changing the basis of futures and options contracts based on the 225-issue Nikkei index to inhibit arbitrage trading.

The ministry only grudgingly began allowing foreign brokerages into the Tokyo exchange in the mid-1980s after other governments threatened to close their own markets to Japanese brokerages.

For most foreign brokerages, the halcyon days of derivatives trading have ended.

Futures volume and commissions are down by about 75 percent, and the now well-established derivatives markets have lost much of the volatility on which arbitrage dealers thrived.

In arbitrage, dealers make money by dealing on momentary gaps between current stock prices and those of derivatives - contracts to buy batches of shares at a certain future price.

Competition for what's left of the market is increasingly fierce.

In 1990, only five or six firms were trading futures and options. Now there are 50, half of them foreign.

''The margins are still there, but they are shrinking,'' Sasaki says.

Salomon Brothers reports that its profits fell 54 percent to 7.7 billion yen ($65 million) in the six months that ended last September. Earlier this month, it announced plans to cut 60 jobs, or 10 percent of its staff, with an early retirement program. It is also considering giving up some office space.

Goldman Sachs, the France's Societe Generale and Bankers Trust, Asia, are among other firms that have seen their business plunge.

Other foreign brokerages that rely more on straightforward broking commissions than on derivatives began slashing staff several years ago.

Merrill Lynch Japan Inc., historically a retail brokerage, said in January that it would close three of six retail branches in Japan in order to focus on institutional trading and high-tech dealings like structured transactions. A spokesman would not say whether staff would be reduced.

Some foreign brokerages are rethinking the wisdom of staying in the costly and increasingly unprofitable Tokyo market, despite having spent years lobbying to win seats on the Tokyo Stock Exchange.

County NatWest Securities Japan last Wednesday sold its seat on the Tokyo exchange to a small Japanese brokerage, Akane Securities Co.

Treadwell said County NatWest's retreat from the market was ''a pretty telling move given the agony that other foreign brokerages had gone through to get seats.''