Barbara Mandel, who divorced Maryland Gov. Marvin Mandel after he left her for another woman, is expected to testify Thursday or Friday as a reluctant prosecution witness in the governor's corruption trial.

She will probably be asked about the divorce settlement - now known to be worth over $300,000 - which she demanded and received before vacating the governor's mansion in Annapolis in 1973.

When he heard that his former wife would testify, Mandel shook his head and said: "It's terribly unfair."

Federal prosecutors have alleged that the governor, who takes home less than $17,000 annually from his $25,000 salary, was assisted in the settlement by his codefendants in the trial. The assistance, prosecutors have maintained, constituted bribes to the governor.

If the governor, his present wife, Jeanne, and Barbara Mandel appear as expected in the courtroom, it will be the first time they have faced one another publicly since the widely publicized divorce and separation.

Barbara Mandel has remained a quiet observer of the Mandel investigation and trial, carefully avoiding reporters' efforts to get her to comment on various revelations as they have occurred.

Her lawyer sought unsuccessfully yesterday to have the subpoena demanding her testimony and documents quashed.

In the previous trial of her former husband, which was declared a mistrial last December, Barbara Mandel did not testify. But the inclusion of codefendant Irvin Kovens in the second trial led to the subpoena for her testimony, according to sources.

Kovens. who was excused from the last trial for health reasons, is alleged to have given Barbara Mandel some $155,000 worth of nontaxable bonds as a favor for his friend, the governor, who was trying to reach a final settlement with his estranged wife.

The divorce was completed in 1974, after Barbara Mandel gave a stubborn six-month effort to save her 32-year marriage to the governor.

Details of the divorce agreement were sealed by a court order in 1974, but havet rickled out in various court proceedings and newspaper articles since.

Barbara Mandel was made a beneficiary of a $100,000 life insurance policy with premiums paid by Mandel codefendants, according to testimony. She also benefited from a $42,000 loan Mandel received from the Pallotine Fathers religious order to help him pay his alimony. Mandel has also said he gave up a $78,000 savings account and a $25,000 business interest in the settlement.

In unrelated testimony, witnesses have said Barbara Mandel also received jewelry valued at more than $5,000 paid for by codefendants.