A federal judge has upheld the The Treasury's longstanding refusal to make public the amount of dollars and U.S. government securities held in the United States by three major Arab oil-exporting countries.

U.S. District Court Judge Barrington D. Parker validated the agreement between the Treasury and the governments of Saudi Arabia, Kuwait and the United Arab Emirates under which they are spared the disclosure required of other countries.

He said, in effect, that the Treasury acted legally in granting the privilege of nondisclosure to the three countries because they asked for it and it therefore was justified on foreign policy grounds.

Parker dismissed a Freedom of Information Act filing by the American Jewish Congress, which sought to compel the Treasury to release the data. The AJC believes that the vast amounts of Arab oil dollars deposited in U.S. banks and invested in U.S. government securities could give the three countries influence over U.S. policy in the Middle East.

Joel H. Levy, the AJC's Washington attorney, said Parker's ruling would be appealed.

The special arrangement between the Treasury and the Arab states originated in 1974, when oil prices soared in the wake of the oil embargo that followed the 1973 Arab-Israeli war. Annual disclosure of foreign holdings in the United States is required by law, but the Treasury revised its reports so that the holdings of all Middle Eastern oil producers are lumped together.

According to Treasury figures submitted to Congress last year, the total of Mideast oil state holdings was $51.3 billion in 1980. Both the AJC and Rep. Benjamin Rosenthal (D-N.Y.), who has been a persistent critic of the Treasury on this issue, have said that the figure vastly understates the true total.

The Treasury said in response to the lawsuit that it was legally precluded from disclosing the country-by-country figures because the governments were virtually the sole source of the investments for the three countries in question, and disclosure therefore would reveal the holdings of specific clients.