In an escalation of Poland's industrial unrest, the independent trade union movement Solidarity demanded reforms today of the country's powerful security apparatus and threatened a general strike in the Warsaw region if six imprisoned activists are not freed.

Both sides under pressure from their own supporters not to back down, and the union's demands pose the most serious challenge to the communist authorities since a crisis over Solidarity's legal registration two weeks ago.

At least five factories in the Warsaw region, including the giant tractor plant at Ursus, staged strikes today to protest the detention of Jan Narozniak, a young Solidarity activist who is under investigation for revealing state secrets. But the affair has suddenly expanded far beyond that case, with the union demanding a full-scale investigation into the power of the security services and the release of political dissidents.

In a last-minute attempt to prevent the dispute from getting out of hand Deputy Premier Mieczyslaw Jagielski talked today with Solidarity officials. There was no immediate word of the talks' outcome.

Meanwhile, industrial troubles worsened in other parts of the country with workers at nine coal mines in southern Poland staging a two-hour warning strike over a pay dispute. Furthermore, railway workers who stopped commuter services in Warsaw and Gdansk for four hours today have threatened to step up their disruption.

The latest crisis was triggered by a police raid last Thursday on Solidarity's Warsaw headquarters, a cramped third-floor apartment. The police confiscated a copy of a letter signed by the prosecutor general that Solidarity contends set guidelines for the harassment and prosecution of union activists and dissidents.

The next day, Narozniak, a volunteer worker in the union's photocopying office, was arrested. So, too, was a worker in the prosecutor's office, Peter Sapielo, who allegedly leaked the document to Solidarity. Both men have now been warned formally that they are under investigation for revealing state secrets.

Narozniak's arrest and the publication of the "secret" document by Solidarity have brought to a head resentment among union activists of what they regard as police harassment. The union's Warsaw branch, supported by the central organization, has evidently decided to make a stand on the issue as well as on police powers in general.

Last week, Solidarity's leader, Lech Walesa, threatened to call selective strikes around the country unless dissidents were released.

The union's demands were announced at a packed press conference this afternoon at the Ursus tractor plant, scene of major strikes in 1976 and earlier this year. The hall was dominated by a huge banner reading, "Free Jan Narozniak," and placards saying "Narozniak today -- Walesa tomorrow."

Among the most controversial union demands are for the establishment of a mixed commission to investigate the prosecutor's office, the police, and the secret police for alleged abuses of authority. A cut in the budget of the secret police has also been demanded.

The political dissidents whom the strikers want freed include Leszek Moczulski, a right-wing nationalist who was arrested last September after calling in newspaper interviews for the overthrow of the communist regime. The union has also demanded the release of three other dissidents who led a march through Warsaw Nov. 11 to mark the anniversary of Poland's independence after World War II, a date ignored in official celebrations.

The strikers have demanded that a government commission come to Ursus by Thursday for negotiations. If the government refuses to appoint a commission, factories throughout the Warsaw region will be told to prepare for a general strike.

Meanwhile, the existing strike could spread to several dozen factories by Wednesday, and a meeting of 2,000 union delegates has been called to discuss the affair. Messages of support for Narozniak came in from many branch offices, including the western town of Lodz, where textile workers involved in their own dispute have said they will occupy administrative offices until he is released.

The new demands have put the communist authorities in an extremely difficult position. To give in to them would imply that the government is willing to override its own laws in response to political pressure. Not to give in is to court a general strike in the Warsaw region that may ultimately spread to other parts of the country.

In Washington, The Associated Press reported, a U.S. official said the Soviet Union had been improving the readiness of its forces near Poland, but there was no evidence that preparations for an attack were under way.

The official, briefing reporters on the condition that he not be identified, said he did not mean to imply that the Soviets were engaged in any new military activities beyond those reported several weeks ago near Poland's border with both East Germany and the Soviet Union. Another official, also speaking privately, likened the Soviet preparations to American attempts to improve military capability in the Middle East.

An important meeting of the Communist Party's policy-making Central Committee has been scheduled for this weekend. Hard-liners in the leadership, some of whom are known to be unhappy with the compromise over Solidarity's registration, are likely to argue against concessions.

There are signs that the authorities may be attempting to mobilize support for a campaign against what senior party officials regard as dangerous demagoguery. The lead story in today's Communist Party newspaper, Trybuna Ludu, was headlined, "We Don't Want to Live in a Condition of Euphoria and Chaos."

It referred to a rally by supporters of the official trade unions at which slogans such as "renewal yes, anarchy no" were displayed.

There are precedents in Poland for the release of activists in response to popular pressure.Members of the dissident Committee for Social Self-Defense (KOR) were freed at the beginning of September as part of a deal worked out with the public prosecutor's office after the signing of the Gdansk agreement that ended summer strikes.

This time, however, the strikers' demands go much further. In addition, authorities consider Moczulski an even more dangerous extremist than the KOR dissidents led by Jacek Kuron.

According to the Polish penal code, a state secret is defined as information that, when revealed to unauthorized people, can damage Poland's political or economic interests. The government's argument is that Narozniak's arrest resulted from the breach of the penal code and should not be construed as a deliberate act of harassment against Solidarity.

The Warsaw branch of Solidarity has also demanded the publication of the official investigation into workers' riots along the Baltic Coast in December 1970. At least 50 workers were killed after police opened fire, but no one has ever been singled out for responsibility.

The 10th anniversary of the massacre (Solidarity claims that many more workers were killed than has officially been admitted) has stirred up emotions. In accordance with the Gdansk agreement, a huge monument will be unveiled Dec. 16 to commemorate the dead.

The union has demanded the dismissal of Warsaw's newly appointed Communist Party chief, Stanislaw Kociolek, accusing him of responsibility for the government's handling of the riots. Officials, however, have insisted that he attempted to avert bloodshed.

An official commission was appointed in 1971 to report on the riots, but its findings were never made public.