TOKYO, SEPT. 8 -- Japan's top trade official left for Washington today in a last-ditch effort to stop Congress from passing a trade bill that would punish Japan for failing to open its markets.

International Trade and Industry Minister Hajime Tamura, on his second trip in two months, took with him some new ammunition the Japanese government has hastily assembled in hopes of removing what Japan sees as the anti-Japanese elements of the trade bill.

Congress reconvenes Wednesday and, early next week, Senate and House conferees are expected to begin working on a compromise trade bill from the two versions passed earlier this year.

The Japanese government opposes the sections of the bill that penalize Japan for not opening its agriculture, construction and automobile parts markets to U.S. products and services.

Congressional anger toward Japan was fueled by the discovery earlier this year that Toshiba Machine Co. exported milling machines to the Soviet Union between 1982 and 1984, allegedly enabling the Soviets to make ultraquiet submarine propellers.

An amendment to the trade bill would ban most Toshiba Corp. exports to the United States for two to five years.

Last Friday the Japanese parliament passed stiffer penalties for illegal exports of strategic goods to the Soviet bloc. Under the new law, a company guilty of exporting strategic goods to the Soviet bloc could be banned from exporting any items to the eastern nations for three years, up from the previous one-year penalty.

Tamura will argue this new law and the doubling of export inspectors from 40 to 80 is evidence of Japan's commitment to ending the flow of sensitive products, a trade official said.

President Reagan is opposed to protectionist legislation and has suggested he may veto the trade bill.

The Reagan administration has praised the new Japanese law but criticized the number of inspectors as still inadequate.

Tamura has scheduled meetings with Defense Secretary Caspar Weinberger and Trade Representative Clayton Yeutte