South Moluccan terrorists holding 56 hostages on a train near here appeared to harden their stand today following the unexpected freeing early this morning of 106 children held by other South Moluccans at a school.

The gunmen on the train fired warning shots late this afternoon and have refused to respong to a request that a pregnant passenger be freed to prevent a miscarriage.

Two deliveries of food were made to the train but Dutch officials warned that sanitation conditions in the hot, crowded cars aredeplorable and getting worse.

"Imagine yourself in a metal box, in the hot sun," one railway official told reporters. "The temperature must have risen to at least 104 degrees. The windows are closed all day."

Intense bargaining efforts by a government crisis staff made little headway with the terrorists on the train, officials said, but Justice Ministry spokesmen refused to give details.

The terrorists, who seek independence for the South Moluccan islands, a part of Indonesia, seized the school and train, about 20 miles apart, in co-ordinated raids on Monday. They are demanding the release of 21 South Moluccans in Dutch jails and want a jumbo jet to fly them out of the country.

The sudden release early this morning of all the school children, aged from 6 to 12, and one of five hostage teachers was obtained through psychological ploys that evoked the specter of a rampant viral epidemic in the classrooms.

Dutch authorities flatly denied that food they had delivered to the school in Bovensmilde had been tainted to trigger symptoms of illness.

"Nature helped us a little bit," Justice Minister Andreas Van Agt remarked.

But asked whether Dutch authorities had exaggerated the childrens' ailments and the threats of "infectious disease," Red Cross spokesman Hans Van Esveld replied, "I would not disagree with you."

Four children, suffering from stomach pains and diarrhea, were freed between noon and midnight yesterday and rushed to a hospital. Two Dutch psychiatrists then persuaded the five terrirists that the remaining 101 pupils had to be evacuated to avert the spread of an "infectious disease." One teacher was freed wtih the children and four stayed behind as hostages.

When one chold complained about feeling ill on Wednesday, the third day of the siege, the psychiatrists advising authorities on how to handle the negotaitions seized this as a pretext to warn the terrorists about the dangerous sanitation conditions in the crowded school rooms and the menance of contagious disease.

When the symptoms grew more intense and afflicted other children, doctors supplied authoritive diagnoses that raised ominous threats of a grave "infectious disease."

Eventually, the five gunmen were convinced that the risk of widespread sickness outweighed their need to hold the children. The youngsters were freed after four teachers agreed to remain hostages to shield the terrorists from a police attack.

Dutch officials said this afternoon that although a communication line had been set up, the gunmen in the school freed the children without consulting their comrades in the train.

About 4 a.m. today a dozen ambulances pulled up to police barricades a half mile from the besieged school. Within an hour, 38 children were whisked to a makeshift medical center set up in a church. Later, 26 of these were taken to a hospital here for futher tests, but Red Cross officials said they are expected to recover rapidly.

A chartered bus retrieved the last 63 children after dawn.

They emerged unescorted from the school, bundled in brown blankets, walking or skipping toward the bus. As they drove past the barriers to the medical station, the pupils waved happily to onlookers, appearing remarkably unaffected by their long ordeal.

After quick examinations, 80 of the children were reunited with their partents. Police took special precautions to keep intruders out of the neighborhoods. Some of the children, however, volunteered details of their incarceration.

One cheeful 11-year-old girl said her class had just begun its knitting lesson when the South Moluccans burst into the room and forced them to gather in the main hall. The children were allowed to take toys, games and drawing equipment with them.

One child said he had been a little afraid, but not much."

During the four-day siege, the children were permitted to watch television but were not given access to the radio, which was kept by the gunmen.

Some complained about sleeping on the hard floor. On the third night mattresses were supplied by the Red Cross.

The food, chiefly sandwiches, milk, soup and fruit, was "very tasty," said one fourth grade girl. Asked if she was still sick, she answered, "Not at all any more."

The children expressed much affection for their teachers, who they said had kept them enraptured by reading and calmed them by singing.

Details of how authorities persuaded the terrorists to released the children are still cloaked in secrecey.

Dick Mulder and Henk Havinga, the psychiatrists coordinating all contacts with the gunmen, remain in the crisis center here. The moment the children were freed, they began negotiations to secure freedom of the remaining four hostages at the school and the 56 on the train.

Borend Bremer, a child psychologist from Utrecht said he feels the children will not be scarred with any traumatic memories form their ordeal.

"It would have been different if violence had occured," he said. "As it was, the children were greatly aided by the teachers and the fact that since it was the end of the school year, they knew one another pretty well."

Bremer said the behavior of the parents now will be a more cruicial matter than any bad dreams the children may have about their experiences with the terrorists.

"Kids will recover faster than grownups," he said. "They are more capable of living in the present than their parents, and are not so bothered by the past."

He also said parents should avoid the temptation to fawn over the abducted children. Instead of providing gifts, they should simply spend a lot of time now renewing previous family ties and not dwell on the nightmarish interruption in their lives.