For years 12 women at the New York office of Sumitomo Shoji America watched in frustration as a procession of men were hired and then stepped over them up the ladder of success.

Finally, in 1979 they brought a job discrimination suit that may set off repercussions far beyond their New York office. The case, now before the Supreme Court, touches sensitive international trade issues and could affect the investment practices in this country of as many as 40 nations. It also could influence the operations of U.S. firms overseas.

For decades Sumitomo, an export-import firm that handles everything from metals to fertilizers, and dozens of other foreign firms that have operations in the United States have selected their own nationals as executives in this country regardless of age, sex or race discrimination laws. They base that practice on friendship, commerce and navigation treaties with the United States that gave American firms those same rights overseas.

The foreign firms favor their own nationals to keep control of their businesses. (In the case of Japanese firms, it's usually men who are chosen for the top posts here.) But the 12 women claim those treaties don't hold up under the Civil Rights Act of 1964, which prohibits employment discrimination. They say: when in America do as American firms do.

Two U.S. appellate courts have reached different conclusions on challenges to the practice. The Fifth Circuit held in one case that treaties exempt foreign firms from requirements of the Civil Rights Act. The Second Circuit held in the Sumitomo case that the company had to comply with U.S. law but could try to demonstrate that it needed to give preference to Japanese nationals because of linguistic or cultural skills, special knowledge of Japanese products and other reasons. The Supreme Court has agreed to hear Sumitomo's appeal.

The case has given foreign firms the jitters because they fear they may be forced to pass control of their companies into the hands of Americans. It has upset U.S. trade officials who worry that treaties will be jeopardized, as well as reciprocal rights given to American firms in foreign countries under those treaties. U.S. officials also are concerned about the impact of the case on current negotiations for bilateral investment treaties with Egypt and Panama.

"What is this decision going to do?" an American trade official asked. "It could be really pivotal in direct investment. If a firm feels it can't keep control of its own investments in the United States, that's certainly a disincentive."

The Reagan administration, still studying the potential implications of the case, hasn't yet decided what position to take in court, an official in the solicitor general's office said.

Foreign-owned companies, which have proliferated across America in the last decade, may decide against locating here if they lose the right to pick their own personnel, taking away thousands of jobs at a time when American unions and government officials are trying to lure such investments.

On the other hand, some Americans like the 12 women feel they have the right to protection from American laws when companies, foreign or domestic, are located on American soil. And if the firms are exempt from employment discrimination laws, the question arises whether they are immune to child labor laws and rules against other forms of worker exploitation.

Although all countries covered under the treaties tend to hire their own nationals, the Japanese do it most blatantly, trade experts say. "It's difficult for American people to understand our unusual ways of controlling quality" and other functions, said Tamio Kawakatsu, a senior vice president with C. Itoh & Co. C. Itoh, an export-import firm operating in the United States with $4 billion in sales and 450 employes, has only one American among its dozen top executives.

The ability to control their own companies and adapt their own management style has been a significant ingredient in Japan's success, trade experts say. As Kawakatsu remarked, the promotion issue is "a difficult question to answer and a touchy problem."

Six years ago C. Itoh won the discrimination suit in which the appellate court said the treaty takes precedence over the Civil Rights Act. C. Itoh has a practice of rotating its U.S. staff every three or four years, at which time the U.S.-based workers return to Japan, the company said.

Kawakatsu argues that many Japanese employes expect to work overtime when Americans will not. "People come to New York for the weekend. Someone has to show them things, play golf, entertain, such things," he said, adding that Americans need "knowledge of how to treat Japanese business customers."

In addition, few Americans know the Japanese language, Kawakatsu and other trade experts said.

"The right conferred by the treaty is an essential component of American trade and economic policy toward Japan," C. Itoh said in a friend of the court brief in the Sumitomo case.

Japanese direct investment in the United States aids "the reduction of bilateral trade frictions between our two countries," said Japan's Ministry of International Trade and Investment in another brief in the Sumitomo case. The agency said Japanese direct investment in the United States in 1980 was $4.2 billion, and Japanese firms provided 350,000 new jobs, mostly for Americans.

"Such Japanese direct investment is helping to revitalize certain United States industrial sectors and contributes favorably to the reduction of the problem of the trade imbalance," the trade ministry said. A decision prohibiting foreign firms from having freedom of choice in hiring would "tend to discourage direct investment to the detriment of both the United States and Japan."

A few Americans have been able to break the Japanese management barrier. At Toyota Motor Sales, U.S.A., for example, two of the four senior vice presidents are Americans, as are five of the firm's seven vice presidents. The American executives are concentrated in sales and marketing.

"It's an advantage to have Americans who are aware of American taste and traditions," explained a company spokesman, who is American.