Abbas - Tanwîr al-Miqbâs min Tafsîr Ibn ‘Abbâs
(For they, if they) the Magians (should come to know of you, will stone you) kill you (or turn you back to their religion) Zoroastrianism; (then ye will never prosper) you will never escape from Allah's punishment.
For indeed if they should come to prevail over, that is, to overwhelm, you, they will [either] stone you, with the rocks of caprice and the exigencies of anger and passionate desire and the pursuit of pleasure and thus slaughter you by preventing you from your perfections; or make you return to their creed, by the prevailing [over you] of estimation and the victory of satan and the inclination to vain desire and the worship of graven images. According to the former interpretation then, [this means] the prevailing of the commonalty and the dominance of the veiled imitators and the exaggerating traditionists, as well as that of the engrained followers of falsehood. As for their stoning of the people of the truth and their call to these [latter] to their own [false] creed, that is apparent just as it had been during the time of God's Messenger, may God bless him and grant him peace.
("...or a part of a day.'' They said: "Your Lord knows best how long you have stayed...'') meaning, `Allah knows best about your situation.' It seems that they were not sure about how long they had slept, and Allah knows best. Then they turned their attention to more pressing matters, like their need for food and drink, so they said:
فَابْعَثُواْ أَحَدَكُمْ بِوَرِقِكُمْ
(So send one of you with this silver coin of yours) They had brought with them some Dirhams (silver coins) from their homes, to buy whatever they might need, and they had given some in charity and kept some, so they said:
(and let no man know of you. For, if they come to know of you, they will stone you) means, `if they find out where you are,'
يَرْجُمُوكُمْ أَوْ يُعِيدُوكُمْ فِى مِلَّتِهِمْ
(they will stone you or turn you back to their religion;) They were referring to the followers of Decianus, who they were afraid might find out where they were, and punish them with all kinds of torture until they made them go back to their former religion, or until they died, for if they agreed to go back to their (old) religion, they would never attain success in this world or the Hereafter. So they said:
وَلَن تُفْلِحُواْ إِذًا أَبَدًا
(and in that case you will never be successful.)
Maududi - Sayyid Abul Ala Maududi - Tafhim al-Qur'an
They were roused from their sleep in the same miraculous way that was employed in sending them to sleep and keeping them hidden from the outer world.
The secret of their sleep was revealed when one of them went to Ephesus to buy food for them and offered a coin of the period of Emperor Decius. As it was a changed world, he naturally attracted attention for he was wearing a costume of 300-year old fashion and spoke a language different from that in vogue. This was because during those two centuries the language, culture, dress etc., had undergone a marked change. So the shopkeeper looked askance at him and, according to a Syriac tradition, suspected that he had dug up some ancient treasure. Accordingly, he gathered some people of his neighborhood and they took him before the ruler. On questioning, it was discovered that he was one of those followers of Christ, who had fled the city 300 years ago to save their Faith. As most of the population had embraced Christianity, the news immediately spread throughout the city and a big crowd of the people along with the Christian Roman Ruler, arrived at the Cave. It was then that the Sleepers of the Cave came to know that they had slept for about three hundred years. So after making salutations to their Christian brothers they lay down and their souls left their bodies.
According to the Syriac tradition, at the time of this occurrence, hot discussions were going on in Ephesus about Resurrection and the Hereafter. Though the people had embraced Christianity under the influence of the Roman Empire, yet traces of shirk and idolatry of the Romans and the effects of the Greek philosophy were still very powerful. So in spite of the Christian creed of the Hereafter, many people denied this, or at least were skeptical about this. To add to this the Sadducee sect of the Jews, who formed a great part of the population of the city, openly denied the Hereafter and professed to base this on the Torah. The Christian scholars, however, could not put forward any strong arguments to refute them: so much so that the reports of the polemical discussion given in Matthew, Mark and Luke, attributed to Prophet Christ, are admittedly very weak even according to the Christian scholars. (Please refer to Matthew 22: 23-33, Mark 12: 18-27, Luke 20: 27-40). That is why the disbelievers in the Hereafter were having the upper hand and even the believers were being involved in doubts about it. It was at that time that the Sleepers of the Cave were raised up and furnished an absolute proof of the life-after-death and turned the scales in favor of the believers in this dispute.
It appears from the context that this was the saying of the righteous people from among the Christians. They were of the opinion that a wall should be raised at the entrance of the Cave in order to let the Sleepers remain in the same condition in which they were, for they argued that their Lord alone knew best about their rank and position and the reward they deserved.
The people "who prevailed in their matter" were the Roman rulers and the priests of the Christian Church, who did not let the righteous Christians have their way. This was because by the middle of the fifth century, the common people, especially the orthodox among the Christians, had become fully involved in shirk and the worship of saints and tombs. They used to visit the tombs of the saints to worship them and kept the statues of Jesus, Mary and the apostles in their churches: so much so that a few years before the rising up of the Sleepers of the Cave, in 431 A.D., a great council of the representatives of the Christian World had been held in Ephesus itself, in which it was resolved that the creed of the divinity of Christ and of Mary as the mother of God, should be included in the articles of the Christian Church. If we keep in view the year 431, it becomes clear that by "those who prevailed in their matter" are meant the leaders of the Church and the officers of the government, who had the reins of the religious and political powers in their hands. In fact these were the people who were the upholders of shirk and who decided that a mausoleum should be built over the Cave of the Sleepers to make it a place of worship.
It is an irony that some people among the Muslims have misconstrued this verse of the Qur'an so as to make it lawful for themselves to build mausoleums, monuments and mosques over the tombs of the righteous persons and saints. The Qur'an has, in fact, pointed out the deviation of the workers of iniquity who prevailed upon others and built a place of worship over the Cave of the Sleepers, who were indeed a Sign of Resurrection and of the life-after-death. But they abused this good opportunity and produced another means of practicing shirk.
One fails to understand how anyone can deduce from this verse an argument for the legality of building mosques over the tombs of the righteous people, when the Holy Prophet has categorically prohibited this:
(1) "Allah has cursed those women who visit tombs and those people who build mosques over them and burn lights over them" (Ahmad, Tirmizi, Abu Dawud, Nasa'i, Ibn Majah).
(2) "Beware that the people, who have passed before you, made the tombs of their Prophets the places of their worship. I forbid you to do that." (Muslim)
(3) "Allah has cursed the Jews and the Christians, for they made the tombs of their Prophets the places of their worship." (Ahmad, Bukhari, Muslim, Nasa'i).
(4) "The behavior of those people was strange: if a righteous person from among them, died they would build a mosque over his grave and draw his pictures. They will be treated as worst criminals on the Day on Resurrection." (Ahmad, Bukhari, Muslim, Nasa'i).
Thus, it is clear from the above Sayings of the Holy Prophet that building of the places of worship over the tombs is utterly unlawful; the Qur'an has merely stated as a historical fact the sinful act of the Christian priests and the Roman rulers and has not sanctioned such a thing. Therefore no God-fearing person can turn this into an argument for building mosques over the tombs.
Incidentally, it will be worth while to cite a statement of Rev. T. Arundell who published his Discoveries in Asia Minor in 1834. He says that he had seen the remains of the Mausoleums of Mary and the Seven Sleepers on a hillock near the remains of the ancient city of Ephesus.