Polish police were holding United Press International's Warsaw correspondent and her Polish assistant tonight, and had questioned a Polish UPI reporter in a case that the U.S. Embassy was informed involved allegations of illegal activities by one or more of the news agency's employes.

The episode is the most serious so far in a recent harassment campaign against western press and U.S. government representatives. Anna Olszewska, a 36-year-old assistant in UPI's Warsaw bureau, was picked up by police this morning at a train station after she was summoned there by a mysterious phone call. The caller, according to other UPI staffers who pieced together the story afterward, apparently advised Olszewska that a package containing rolls of film from the northern port city of Gdansk was en route to UPI with a female train conductor who was arriving in midmorning.

A photographer in Gdansk who has taken pictures for UPI has denied placing any such call. Observers later surmised that the phone call may have been a trap.

Early this evening, police bearing official summons for UPI correspondents Ruth Gruber, an American, and Bogdan Turek, a Pole, escorted both staffers from the bureau's offices to the city's main police headquarters where they were questioned. Turek was released several hours later, but Gruber has been detained for the rest of the night, according to a police spokesman.

An American diplomat who attempted to visit Gruber, 33, at the station was told that she was being interrogated concerning "activities against the laws of the Polish People's Republic." But the diplomat said it was not clear whether the alleged illegal activites had been committed by Gruber or Olszewska or both.

Noting that the consular convention between the United States and Poland does not require immediate contact between an official U.S. representative and a person held in Gruber's circumstances, the diplomat said he was told by police officials that he would be able to see or talk to Gruber by Wednesday morning. Under Polish law, a person can be held by police without formal charges for up to 48 hours.

Describing his round of questioning, Turek said that a police interrogator had indicated that the package at the train station contained damaging material but gave no specifics.

Beyond the station incident involving Olszewska, Turek said the thrust of the questioning was directed at Gruber's own activities during her two years as UPI's Warsaw correspondent.

Turek, 46, said the police seemed especially curious about how often Gruber traveled, particularly her infrequent trips to Gdansk, and what her contacts there were. He said he and Gruber had been questioned in separate rooms and he figured he was released relatively early in part to advise other news organizations of the case.

"My impression was they wanted as much publicity as possible," Turek said, suggesting that one police aim simply may be to intimidate other reporters and their staffs.

Since the suspension of martial law in Poland last month, authorities here have taken steps to discipline western reporters and their assistants for what officials contend have been violations of Polish work regulations and distorted news reports.

At least nine Polish staffers assisting western news organizations in Warsaw have been refused renewal of their work permits, and a reporter for the British Broadcasting Corp. has been expelled following the Polish government's ire over a BBC program on martial law.

Meanwhile, 41 of the 233 Polish employes hired by the U.S. Embassy are facing the threat of being denied permission to continue work at the embassy.

Speaking to reporters today, government spokesman Jerzy Urban insisted that authorities did not want to interfere with the work of foreign correspondents and said that the difficulties that the news assistants are encountering are only indirectly related to U.S.-Polish strains.

Urban said that work permits for some news assistants were not being renewed because those Polish staffers had violated their job standards. Official regulations permit Polish assistants to provide western correspondents with only technical help, but Urban said some had engaged in actual reporting.