Senate Majority Leader Robert J. Dole (R-Kan.) yesterday assailed Japan for failing to take speedy action to cut its burgeoning trade surplus with the United States and called for Senate action early next year on two trade measures aimed directly at the Japanese.

"It is time to take stronger action," said Dole, who recalled that he had visited Tokyo in August and warned "that there was a brief window of opportunity to take meaningful action to open Japanese markets and to address the concerns we raised" over the trade imbalance.

"That window is about to be slammed shut, and no real measurable improvement has been achieved," Dole said in a Senate speech.

Dole, a possible candidate for the 1988 Republican presidential nomination, appeared to be signaling a new congressional assault on trade next year that is likely to focus more directly on countries such as Japan that have large trade surpluses with the United States.

Senate trade specialists said Dole has grown increasingly irritated with Japan, which is expected to post a record $50 billion trade surplus with the United States this year.

He has tried in the waning days of this session of Congress to win unanimous consent for the Senate to consider two measures aimed at Japan's trade practices.

Senate sources said one reason for Dole's anger is his feeling that he had received assurances from executives of Toyota Motor Corp. during his Tokyo visit that they would build their new manufacturing plant in his home state of Kansas. Instead, Kentucky was selected.

In his Senate speech, Dole said the trade problem is likely to be worsened by the comment of a Japanese official that voluntary restraints in auto sales are likely to end next year.

"No amount of rhetoric can change the fact that this decision will widen the U.S.-Japan trade deficit," Dole said.

President Reagan said last year that the United States didn't want Japan to continue the auto restraints, then reacted angrily when Tokyo kept them on at a high level.

There are reports from within the administration that the State Department is trying to paper over trade differences with Japan in the interest of the overall relationship between the two nations.

Dole's speech comes as a large and influential delegation of senators, headed by John C. Danforth, chairman of the Senate Commerce Committee and of the trade subcommittee of the Finance Committee, is preparing for a visit to the Far East that includes a major stop in Tokyo.

The strong language of the Dole speech was seen on Capitol Hill as foreshadowing the message the Danforth delegation will be carrying to Tokyo and other Asian capitals: Congress and the American people are unwilling to tolerate continued large trade surpluses that arise largely as a result of unfair trade practices and closed markets in Japan and the newly industrialized countries of the Pacific Rim such as Taiwan and South Korea.

That argument has not been well received in Tokyo, where a senior Japanese trade official told foreign correspondents Tuesday that his country's policies are not to blame for its trade surpluses.

Makoto Kuroda of the Ministry of International Trade and Industry said world price fluctuations and the strong American dollar were responsible for Japan's trade surpluses, which he said are likely to continue to grow.

Dole called for swift Senate action next year on three bills -- two aimed directly at Japan.

The harshest one, introduced by Danforth and passed as a nonbinding resolution by a 98-0 Senate vote last spring, is called "The Japanese Unfair Trade Practices Bill." It requires the president to take all needed actions to eliminate Japanese trade barriers to American products or to retaliate against imports from Japan.

Another measure, also sponsored by Danforth, requires other countries to give American telecommunications equipment suppliers the same opportunities that their countries get in the United States. Although that bill would affect all countries, it contains special language singling out Japan.

The third bill is a broad-based bipartisan measure to tighten U.S. trade laws and force the president to keep the dollar in balance with other currencies. It was introduced in the Senate a month ago.

Dole said he decided to press for quick passage of those bills because Japan's highly touted moves to narrow the trade imbalance have proved to be "largely symbolic."

"I am disappointed to say that little progress has been made" since Prime Minister Yasuhiro Nakasone announced in August an "action program" to increase Japanese purchases of foreign products and eliminate existing import barriers, Dole said.