In “Elegy Written in a Country Churchyard”, there is a reference to Oliver Cromwell who ruled England from 1649 to 1658. He was in the Army under the command of King Charles-I. Later on, he supported the puritan leaders who protested against the miss-rule of Charles-I. He fought against the Army of the King and defeated them. Under his leadership, the King was imprisoned, tried, and beheaded in 1649. After the death of King, Cromwell became the ruler of England. He was known to be brave.
Gray here compares the villagers to him to indicate that there might have been a few people among the dead villagers who were as brave as Cromwell but they did not get a chance to show their bravery. For their death, the country suffered positive losses. By this reference, Gray glorifies the poor villagers and creates a gloomy mood.