Montgomery County Circuit Court Judge Stanley B. Frosh yesterday sentenced a man convicted of raping a Takoma Park woman at knifepoint in the elevator of her apartment building to life imprisonment, the maximum sentence allowed under Maryland sentencing statutes.

Kendall M. Cunningham, 29, of 10104 Lorain Ave., Silver Spring, was found guilty in April of first-degree rape, a first-degree sex offense and robbery with a dangerous and deadly weapon in an assault at 7600 Maple Ave. in November 1984.

Frosh also sentenced Cunningham to 25 years on the first-degree sex offense charge to be served concurrently, and 15 years on the armed robbery charge that will run consecutive to the life sentence, Tamm said.

In issuing the unusually stiff sentence yesterday, Frosh described the rape as especially brutal and said, "This is only the second time in my 11 years on the bench that I have considered a life sentence, except for a life sentence in a brutal murder case."

The victim, a 35-year-old Sunday school teacher, was attacked after a man followed her into the elevator. Her assailant stopped the elevator between floors, and then raped the woman and forced her to commit sodomy after he demanded money, according to Montgomery County assistant prosecutor Thomas Tamm.

Tamm said he was gratified by the sentence imposed by Frosh, who has been sharply criticized in the past by Montgomery County State's Attorney Andrew Sonner for being lenient.

Cunningham also was sentenced to an 15-year prison term to be served consecutively in an unrelated armed robbery charge to which he had pleaded guilty. In that incident, also on Maple Avenue in Takoma Park, another woman was robbed at knifepoint by a man who accosted her in the elevator of an apartment building.