The Maryland Senate, for the second year in a row, has blocked a measure that would have barred the state from executing persons convicted of committing first-degree murder while under the age of 18.

The Senate scuttled the bill sponsored by Sen. Decatur W. Trotter (D-Prince George's) on a 25-to-21 vote yesterday after a long debate on capital punishment.

The debate, one of the most emotionally charged of the session, pitted many of the Senate's blacks and liberals against their more conservative colleagues.

"It is my hope that a sense of humanity will be in this Senate," said Sen. Margaret C. Schweinhaut (D-Montgomery), who quoted a passage from Shakespeare in her defense of the bill.

Trotter's legislation, which had cleared the Judicial Proceedings Committee, would have mandated life imprisonment for persons convicted of first-degree murder who were under the age of 18 at the time of the crime.

There is one prisoner on Maryland's death row who would be in that category.

John A. Cade, the Senate minority leader, argued that passage of Trotter's bill could lead to "a new class of teen-aged thugs recruited by a modern-day Fagin to prey upon the public."

Sen. John C. Coolahan, a conservative Democrat from Baltimore County and the leading opponent of the Trotter bill, said, "The state has a right to punish . . . and take its pound of flesh after due process."