The two top officials of Maryland's troubled prison system resigned today, saying that public outcry over the indictment last week of 27 inmates from the Brockbridge prerelease center has rendered them ineffective.

Gov. Harry Hughes, who has supported his controversial prisons chiefs against growing public criticism, said tonight that he made no attempt to persuade Public Safety and Corrections Secretary Gordon C. Kamka and Corrections Commissioner Edwin R. Goodlander to stay in their jobs.

"They felt that in the present situation, they could no longer function effectively. I agreed with that assessment," the governor said somberly at a hastily called press conference. Hughes said Kamka submitted the resignations in an hour-long meeting this afternoon, at which Goodlander was not present.

The governor stressed that he did not press for the resignations, although he had publicly criticized Goodlander last Friday for using "poor judgment" in not following up several advance warnings that work-release inmates were involved in "questionable activities."

Goodlander received the warnings at least four months before Thursday's dramatic charges by a Baltimore grand jury that the 27 inmates at Brockbridge Correctional Camp in Jessup committed muder, rape, robbery and narcotics violations while they were supposed to be participating in work-release programs in Baltimore. Yesterday corrections officials suspended all work-release programs in Baltimore pending an investigation.

The indictments were the latest and most serious crisis for the state prisons system, which has been embroiled in controversy almost since Hughes took office and named Kamka as his first cabinet appointment.

Legislators and local officials, who had from the outset criticized Kamka's relatively liberal corrections philosophies, pointed to the Baltimore indictments as proof that his approach had failed. Kamka, the former Baltimore City jail warden, embraced a philosophy that focused on community-based rehabilitation centers at a time that many politicians were clamoring for the state to build more secure prisons.

Hughes stressed tonight, however, that the indictments have not weakened his support for his former commissioner's philosophy. From the outset, the governor has said that the problems at Brockbridge raise questions only about the department's management, not about its policies.

Meanwhile, legislators who had been most critical of Kamka's approach tonight said they welcomed news of his resignation. "It has to happen," said Senate Majority Leaders Edward Mason (R-Garrett). I feel sorry for them [Kamka and Goodlander] personally, but they were living in a dream world, both of them."

However, some of Kamka's sharpest critics agreed with the governor's position that the incident reflects only on the department's management. Said Del. Timothy Maloney (D-Prince George's), one of several delegates pushing for construction of a new prison: "This is not a victory for anyone. His failures as a secretary can't be interpreted as the failure of his philosophy or the programs he had."

The continuing controversy over corrections policies under Kamka did play a role in his decision to resign, Hughes acknowledged.

"I think it's been a growing thing over a period of time," Hughes said. "This didn't just happen in two days. He has been under mounting pressure for some time. I command him, frankly for coming to this decision as someone who feels strongly about his profession."

Kamka became the center of controversy as soon as he was appointed in January 1979, when he and Hughes announced that they were scrapping plans for a new medium-security prison, and would attempt to solve the system's severe overcrowding problems by adding beds in community-based facilities. Kamka appointed Goodlander to head his corrections division soon after being named by Hughes.

Hughes and Kamka, faced with a federal court order to relieve overcrowding, elected to move prisoners more quickly through the system -- from maximum- and medium-security settings to community-based centers, and then back to the community. Kamka repeatedly argued that most prisoners would eventually return to society and needed to serve time in community settings to make the transition.

While critics charged that the system was moving violent offenders back into minimum-security settings like Brockbridge before they were ready, Hughes consistently backed his corrections chief.

However, under mounting legislative pressure, Hughes last year backed away from his pledge to build no new major prisons, and supported the construction of a new 500-bed facility in the neighborhood of the Maryland Penitentiary in Baltimore. That prison, and a new, 400-bed, medium-security prison in Jessup that is scheduled to open in the next five months are expected to help relieve overcrowding, which still has not been reduced as much as the court has ordered.

Hughes tonight had limited praise for Kamka's tenure, but, apparently weary of the heated philosophical arguments surrounding Kamka's tenure, said he will try not to pick a new corrections chief who carries a specific label.