The 14 most prominent Japanese who were tried for war crimes after World War II have been enshrined in Tokyo's Yasukuni Shrine, touching off an emotionally charged debate and reviving painful memories of their trials.

They include Hideki Tojo, military leader and wartime prime minister, and 13 others whom the Allied occupation forces judged most responsible for leading Japan into its disastrous Pacific war.

Seven of the "Class A" war criminals, including Tojo, were hanged, five others found guilty eventually died in prison, and two died during their trials.

Their enshrinement last October in the major Shinto shrine devoted to the memory of Japan's war dead was kept secret until yesterday, apparently out of concern for public critism.

The revelation of the enshrinement by the Asahi newspapers sparked immediate charges that it was an attempt to reverse the official split between state and religion, a small step toward the prewar nationalism that is seen by leftist critics as a growing threat. The Socialist Party denounced the ceremony as "impermissible," saying it excused crimes of a military elite that caused Japan much suffering.

A major middle-of-the-road newspaper, the Yomiuri, called it "highly regrettable" and said, "To us it looks like an ominous sign indication a renewed tieup between the shrine and nationalism based on Shinto."

At the shrine, however, priests defended the enshrinement as justice for the men who had served the country and as solace for the surviving members of their families.

Shozo Furukawa, a priest at the large shrine in central Tokyo, said in an interview today that the basic decision to enshrine the 14 men had been made 20 years ago but that the ceremony had been delayed because of "domestic conditions," feelings of the Japanese people and sentiments of the families involved.

Last September, he noted, was the 33rd anniversary of the end of the war and the shrine's officers felt it was their "last chance" to honor the 14 accused men. He explained that in Buddhist, although not in Shinto, thought, the 33rd anniversary of a death is considered the last year to celebrate spirits of the deceased. "It was a very important time," Furukawa added.

Shintoism, the ancestral religion of Japan, is indigenous to the nation whereas Buddhism was imported from India via the Chinese mainland. The two religions flourish side by side in Japan and many Japanese practice both.

Shinto was Japan's prewar national religion, often used to justify military policies, Japan's postwar constitution ended the close association between state and Shintoism and Yasukuni Shrine is now privately financed and managed.

Any move to reassociate the government formally with Shinto shrines or services provokes protests. In recent years, Japanese prime ministers have revived the practice of visiting Yasukuni Shrine each spring and each visit is accompanied by angry political debate.

Prime Minister Masayoshi Ohira, a Christian, recently had announced that he would visit the shrine this Saturda. He said today he would visit it despite the uproar over the enshrinement of the accused war criminals.

Christian groups that oppose a revival of state Shinto were upset by the news of the enshrinements as were some families that have objected to their dead ancestors being anshrined at Yasukuni against their wishes.

Saburo Tsunoda, a Protestant missionary in Yokohama, said the enshrinement was part of a movement that would deny the responsibility of all Japanese people and particularly war leaders for Japan's aggression in the 1930s and 1940s.

Tsunoda heads a group of families who object to the previous enshrinement of dead relatives and who threaten to sue if the government offers official support to the shrine. Legislation to support Yasukuni with public fundshas been pending in parliament for several years but is not expected to be enacted because it would violate constitutional provisions on the church-state relationship.

The shrine, with its towering entrance gates called torii , is a major tourist attraction in Tokyo and is often visited by throngs of Japanese paying respect to dead soldiers. Near its main gate is a statue of Masujiro Omura, founder of the modern Japanese Army. A museum contains many photographs and relics of World War II, including a one-man suicide submarine used to ram enemy ships.

Enshrinement at Yasukuni involves a brief ceremony in which the deceased's name is written on a sheet of parchment in the belief that this will momentarily recall the departed spirits to their loved ones. The parchment is kept at the shrine for a brief period and then filed in an archive.

More than 2 million names of both military and civilian war dead are on the shrine's lists, which date back to the 1870s.

The names of other accused war criminals whose offenses were regarded as less serious already have been enshrined at Yasukuni, but the "Class A" accused criminals were omitted until last October because of public sensitivity.

The trial of Tojo and others began in May 1946 and lasted for 2 1/2 years. Tojo and six others were hanged in December 1948. CAPTION: Picture, HIDEKI TOJO . . . hanged as war criminal