The reference to "virgins" is an allusion to the elect remnant of the northern kingdom, that is, of the lost sheep of the house of Israel. These are the elect remnant of the northern kingdom and the elect remnant of the southern kingdom "fused" into one stick aka the 144,000 and "little flock". These were the bones in the valley of dry bones that were resurrected on Pentecost.
[Eze 37:1-28 ASV] (1) The hand of Jehovah was upon me, and he brought me out in the Spirit of Jehovah, and set me down in the midst of the valley; and it was full of bones. (2) And he caused me to pass by them round about: and, behold, there were very many in the open valley; and, lo, they were very dry. (3) And he said unto me, Son of man, can these bones live? And I answered, O Lord Jehovah, thou knowest. (4) Again he said unto me, Prophesy over these bones, and say unto them, O ye dry bones, hear the word of Jehovah. (5) Thus saith the Lord Jehovah unto these bones: Behold, I will cause breath to enter into you, and ye shall live. (6) And I will lay sinews upon you, and will bring up flesh upon you, and cover you with skin, and put breath in you, and ye shall live; and ye shall know that I am Jehovah. (7) So I prophesied as I was commanded: and as I prophesied, there was a noise, and, behold, an earthquake; and the bones came together, bone to its bone. (8) And I beheld, and, lo, there were sinews upon them, and flesh came up, and skin covered them above; but there was no breath in them. (9) Then said he unto me, Prophesy unto the wind, prophesy, son of man, and say to the wind, Thus saith the Lord Jehovah: Come from the four winds, O breath, and breathe upon these slain, that they may live. (10) So I prophesied as he commanded me, and the breath came into them, and they lived, and stood up upon their feet, an exceeding great army. (11) Then he said unto me, Son of man, these bones are the whole house of Israel: behold, they say, Our bones are dried up, and our hope is lost; we are clean cut off. (12) Therefore prophesy, and say unto them, Thus saith the Lord Jehovah: Behold, I will open your graves, and cause you to come up out of your graves, O my people; and I will bring you into the land of Israel. (13) And ye shall know that I am Jehovah, when I have opened your graves, and caused you to come up out of your graves, O my people. (14) And I will put my Spirit in you, and ye shall live, and I will place you in your own land: and ye shall know that I, Jehovah, have spoken it and performed it, saith Jehovah. (15) The word of Jehovah came again unto me, saying, (16) And thou, son of man, take thee one stick, and write upon it, For Judah, and for the children of Israel his companions: then take another stick, and write upon it, For Joseph, the stick of Ephraim, and for all the house of Israel his companions: (17) and join them for thee one to another into one stick, that they may become one in thy hand. (18) And when the children of thy people shall speak unto thee, saying, Wilt thou not show us what thou meanest by these? (19) say unto them, Thus saith the Lord Jehovah: Behold, I will take the stick of Joseph, which is in the hand of Ephraim, and the tribes of Israel his companions; and I will put them with it, even with the stick of Judah, and make them one stick, and they shall be one in my hand. (20) And the sticks whereon thou writest shall be in thy hand before their eyes. (21) And say unto them, Thus saith the Lord Jehovah: Behold, I will take the children of Israel from among the nations, whither they are gone, and will gather them on every side, and bring them into their own land: (22) and I will make them one nation in the land, upon the mountains of Israel; and one king shall be king to them all; and they shall be no more two nations, neither shall they be divided into two kingdoms any more at all; (23) neither shall they defile themselves any more with their idols, nor with their detestable things, nor with any of their transgressions; but I will save them out of all their dwelling-places, wherein they have sinned, and will cleanse them: so shall they be my people, and I will be their God. (24) And my servant David shall be king over them; and they all shall have one shepherd: they shall also walk in mine ordinances, and observe my statutes, and do them. (25) And they shall dwell in the land that I have given unto Jacob my servant, wherein your fathers dwelt; and they shall dwell therein, they, and their children, and their children's children, for ever: and David my servant shall be their prince for ever. (26) Moreover I will make a covenant of peace with them; it shall be an everlasting covenant with them; and I will place them, and multiply them, and will set my sanctuary in the midst of them for evermore. (27) My tabernacle also shall be with them; and I will be their God, and they shall be my people. (28) And the nations shall know that I am Jehovah that sanctifieth Israel, when my sanctuary shall be in the midst of them for evermore.
[Jer 31:1-40 ASV] (1) At that time, saith Jehovah, will I be the God of all the families [IE: "tribes"] of Israel, and they shall be my people. (2) Thus saith Jehovah, The people that were left of the sword found favor in the wilderness; even Israel, when I went to cause him to rest. (3) Jehovah appeared of old unto me, saying, Yea, I have loved thee with an everlasting love: therefore with lovingkindness have I drawn thee. (4) Again will I build thee, and thou shalt be built, O virgin of Israel: again shalt thou be adorned with thy tabrets, and shalt go forth in the dances of them that make merry. (5) Again shalt thou plant vineyards upon the mountains of Samaria; the planters shall plant, and shall enjoy the fruit thereof. (6) For there shall be a day, that the watchmen upon the hills of Ephraim shall cry, Arise ye, and let us go up to Zion unto Jehovah our God. (7) For thus saith Jehovah, Sing with gladness for Jacob, and shout for the chief of the nations: publish ye, praise ye, and say, O Jehovah, save thy people, the remnant of Israel. (8) Behold, I will bring them from the north country, and gather them from the uttermost parts of the earth, and with them the blind and the lame, the woman with child and her that travaileth with child together: a great company shall they return hither. (9) They shall come with weeping; and with supplications will I lead them: I will cause them to walk by rivers of waters, in a straight way wherein they shall not stumble; for I am a father to Israel, and Ephraim is my first-born. (10) Hear the word of Jehovah, O ye nations, and declare it in the isles afar off; and say, He that scattered Israel will gather him, and keep him, as a shepherd doth his flock. (11) For Jehovah hath ransomed Jacob, and redeemed him from the hand of him that was stronger than he. (12) And they shall come and sing in the height of Zion, and shall flow unto the goodness of Jehovah, to the grain, and to the new wine, and to the oil, and to the young of the flock and of the herd: and their soul shall be as a watered garden; and they shall not sorrow any more at all. (13) Then shall the virgin rejoice in the dance, and the young men and the old together; for I will turn their mourning into joy, and will comfort them, and make them rejoice from their sorrow. (14) And I will satiate the soul of the priests with fatness, and my people shall be satisfied with my goodness, saith Jehovah. (15) Thus saith Jehovah: A voice is heard in Ramah, lamentation, and bitter weeping, Rachel weeping for her children; she refuseth to be comforted for her children, because they are not. (16) Thus saith Jehovah: Refrain thy voice from weeping, and thine eyes from tears; for thy work shall be rewarded, saith Jehovah; and they shall come again from the land of the enemy. (17) And there is hope for thy latter end, saith Jehovah; and thy children shall come again to their own border. (18) I have surely heard Ephraim bemoaning himself thus, Thou hast chastised me, and I was chastised, as a calf unaccustomed to the yoke: turn thou me, and I shall be turned; for thou art Jehovah my God. (19) Surely after that I was turned, I repented; and after that I was instructed, I smote upon my thigh: I was ashamed, yea, even confounded, because I did bear the reproach of my youth. (20) Is Ephraim my dear son? is he a darling child? for as often as I speak against him, I do earnestly remember him still: therefore my heart yearneth for him; I will surely have mercy upon him, saith Jehovah. (21) Set thee up waymarks, make thee guide-posts; set thy heart toward the highway, even the way by which thou wentest: turn again, O virgin of Israel, turn again to these thy cities. (22) How long wilt thou go hither and thither, O thou backsliding daughter? for Jehovah hath created a new thing in the earth: a woman shall encompass a man. (23) Thus saith Jehovah of hosts, the God of Israel, Yet again shall they use this speech in the land of Judah and in the cities thereof, when I shall bring again their captivity: Jehovah bless thee, O habitation of righteousness, O mountain of holiness. (24) And Judah and all the cities thereof shall dwell therein together, the husbandmen, and they that go about with flocks. (25) For I have satiated the weary soul, and every sorrowful soul have I replenished. (26) Upon this I awaked, and beheld; and my sleep was sweet unto me. (27) Behold, the days come, saith Jehovah, that I will sow the house of Israel and the house of Judah with the seed of man, and with the seed of beast. (28) And it shall come to pass that, like as I have watched over them to pluck up and to break down and to overthrow and to destroy and to afflict, so will I watch over them to build and to plant, saith Jehovah. (29) In those days they shall say no more, The fathers have eaten sour grapes, and the children's teeth are set on edge. (30) But every one shall die for his own iniquity: every man that eateth the sour grapes, his teeth shall be set on edge. (31) Behold, the days come, saith Jehovah, that I will make a new covenant with the house of Israel, and with the house of Judah: (32) not according to the covenant that I made with their fathers in the day that I took them by the hand to bring them out of the land of Egypt; which my covenant they brake, although I was a husband unto them, saith Jehovah. (33) But this is the covenant that I will make with the house of Israel after those days, saith Jehovah: I will put my law in their inward parts, and in their heart will I write it; and I will be their God, and they shall be my people. (34) And they shall teach no more every man his neighbor, and every man his brother, saying, Know Jehovah; for they shall all know me, from the least of them unto the greatest of them, saith Jehovah: for I will forgive their iniquity, and their sin will I remember no more. (35) Thus saith Jehovah, who giveth the sun for a light by day, and the ordinances of the moon and of the stars for a light by night, who stirreth up the sea, so that the waves thereof roar; Jehovah of hosts is his name: (36) If these ordinances depart from before me, saith Jehovah, then the seed of Israel also shall cease from being a nation before me for ever. (37) Thus saith Jehovah: If heaven above can be measured, and the foundations of the earth searched out beneath, then will I also cast off all the seed of Israel for all that they have done, saith Jehovah. (38) Behold, the days come, saith Jehovah, that the city shall be built to Jehovah from the tower of Hananel unto the gate of the corner. (39) And the measuring line shall go out further straight onward unto the hill Gareb, and shall turn about unto Goah. (40) And the whole valley of the dead bodies and of the ashes, and all the fields unto the brook Kidron, unto the corner of the horse gate toward the east, shall be holy unto Jehovah; it shall not be plucked up, nor thrown down any more for ever.
I understand the word "virgins" to be metonymy for avoidance of all vices. That is, these "virgins" had self control and they were never of the lawless, idolatrous gentiles.
It is difficult to speak with much authority about the cryptic imagery of Revelation but speaking speculatively I would say that the 144,000 are the faithful Jewish remnant that were saved under the old covenant. This would include of course Moses, David, Matthew and Peter. These were Yehovah's sheep until he committed them into Jesus' care. They were the little flock. The remnant of the Jews. The reason they are called "virgins" (I believe, tentatively) is that they were never idolaters.
For some background on a group of elect being extracted prior to judgment consider Enoch, Noah, Lot, etc. and here: