Workers and farmers in southeast Poland staged a one-hour warning strike yesterday to protest government harassment of union activists and support demands for recognition of a rural union.

The strike was called by the regional branch of the independent Solidarity union organization in the city of Przemysl to support a group of farmers who have occupied a local government office in the town of Ustrzyki Dolne, near the Soviet border, since Dec. 29. Another group of 600 farmers and Solidarity workers also occupied headquarters of the old state-run union in a related action in the town of Rzeszow.

The demonstrators were mainly protesting the harassment of independent union activists, but were also calling for registration of a private farmers' union and the punishment of officials involved in quelling food-price riots in 1976.

The protest actions came a day after meetings in Warsaw between Solidarity leader Lech Walesa and Deputy Prime Minister Mieczyslaw Jagielski on the farmers' sit-ins and Solidarity's demand for work-free Saturdays. Solidarity sources said it appeared some agreement had been reached on the Rzeszow and Ustrzyki Dolne problems but gave no details.

The sources said a six-member delegation had arrived in Ustrzyki Dolne for talks with the demonstrators. The rural union organization has about 1 million members and represents one-fifth of Poland's private farmers.

If agreement on the demands is not reached by Jan. 10, the organizers said, they would call a strike in the area.