I believe these are literally Moses and Elijah, by comparing what Revelation says about the two witnesses with the Old Testament accounts of Moses and Elijah.
Revelation 11:3-5 And I will give power unto my two witnesses, and
they shall prophesy a thousand two hundred and threescore days,
clothed in sackcloth. These are the two olive trees, and the two
candlesticks standing before the God of the earth. And if any man will
hurt them, fire proceedeth out of their mouth, and devoureth their
enemies: and if any man will hurt them, he must in this manner be
killed. These have power to shut heaven, that it rain not in the days
of their prophecy: and have power over waters to turn them to blood,
and to smite the earth with all plagues, as often as they will.
First, "fire proceedeth out of their mouth, and devoureth their enemies: and if any man will hurt them, he must in this manner be killed".
The only person in the Bible with this unique characteristic, of calling down fire upon their enemies, was Elijah.
II King 1:9-12 Then the king sent unto him a captain of fifty with his
fifty. And he went up to him: and, behold, he sat on the top of an
hill. And he spake unto him, Thou man of God, the king hath said, Come
down. And Elijah answered and said to the captain of fifty, If I be a
man of God, then let fire come down from heaven, and consume thee and
thy fifty. And there came down fire from heaven, and consumed him and
his fifty. Again also he sent unto him another captain of fifty with
his fifty. And he answered and said unto him, O man of God, thus hath
the king said, Come down quickly. And Elijah answered and said unto
them, If I be a man of God, let fire come down from heaven, and
consume thee and thy fifty. And the fire of God came down from heaven,
and consumed him and his fifty.
Next, "These have power to shut heaven, that it rain not in the days
of their prophecy"
Elijah also caused rain to cease when he was on the earth.
I Kings 17:1 And Elijah the Tishbite, who was of the inhabitants of
Gilead, said unto Ahab, As the LORD God of Israel liveth, before whom
I stand, there shall not be dew nor rain these years, but according to
my word.
I Kings 18:1 And it came to pass after many days, that the word of the
LORD came to Elijah in the third year, saying, Go, shew thyself unto
Ahab; and I will send rain upon the earth.
I Kings 18:41 And Elijah said unto Ahab, Get thee up, eat and drink;
for there is a sound of abundance of rain.
Finally, "and have power over waters to turn them to blood, and to smite the earth with all plagues, as often as they will."
Who does this sound like? Turning the water into blood? Smiting the earth with plagues?
Exodus 7:19-20 And the LORD spake unto Moses, Say unto Aaron, Take thy
rod, and stretch out thine hand upon the waters of Egypt, upon their
streams, upon their rivers, and upon their ponds, and upon all their
pools of water, that they may become blood; and that there may be
blood throughout all the land of Egypt, both in vessels of wood, and
in vessels of stone. And Moses and Aaron did so, as the LORD
commanded; and he lifted up the rod, and smote the waters that were in
the river, in the sight of Pharaoh, and in the sight of his servants;
and all the waters that were in the river were turned to blood.
The story of the plagues in Egypt would take up a lot of space, but most people are already familiar enough with that story.
Elijah and Moses were taken from the earth
Per 2 Kings 2:11, Elijah went to heaven in a fiery chariot and did not see death. Jude verse 9 tells of a conflict between Michael and Satan over the body of Moses (also see the apocryphal Book of Enoch), indicating that his body was removed from the earth.
Both Elijah and Moses appeared at the Mount Transfiguration scene
Luke 9:28-31 And it came to pass about an eight days after these
sayings, he took Peter and John and James, and went up into a mountain
to pray. And as he prayed, the fashion of his countenance was altered,
and his raiment was white and glistering. And, behold, there talked
with him two men, which were Moses and Elias: Who appeared in glory,
and spake of his decease which he should accomplish at Jerusalem.