Personally, I don't believe that they were forgiven at the moment when Jesus prayed for them. There are several reasons why I don't believe it, and one of those reasons is the reason that you just mentioned in relation to their need to repent in order to actually be forgiven.
Here's another:
Psalm 2
[1] Why do the heathen rage, and the people imagine a vain thing?
[2] The kings of the earth set themselves, and the rulers take counsel together, against the LORD, and against his anointed, saying,
[3] Let us break their bands asunder, and cast away their cords from us.
The first three verses of this prophetic Messianic psalm foretold of the time when "the heathen" (the Roman soldiers), "the people" (certain Jews of Jesus' day), "the kings of the earth" (Herod), "and the rulers" (Pontius Pilate) would "take counsel together, against the LORD, and against his anointed" or "against his Christ) as they joined hands together to crucify Jesus.
This is by no means my "private interpretation", but rather the plain teaching of scripture.
We read:
Acts chapter 4
[23] And being let go, they went to their own company, and reported all that the chief priests and elders had said unto them.
[24] And when they heard that, they lifted up their voice to God with one accord, and said, Lord, thou art God, which hast made heaven, and earth, and the sea, and all that in them is:
[25] Who by the mouth of thy servant David hast said, Why did the heathen rage, and the people imagine vain things?
[26] The kings of the earth stood up, and the rulers were gathered together against the Lord, and against his Christ.
[27] For of a truth against thy holy child Jesus, whom thou hast anointed, both Herod, and Pontius Pilate, with the Gentiles, and the people of Israel, were gathered together,
[28] For to do whatsoever thy hand and thy counsel determined before to be done.
Again, the first three verses of Psalm 2, a prophetic Messianic psalm, were fulfilled when "Herod, and Pontius Pilate, with the Gentiles (or heathen), and the people of Israel, were gathered together" to crucify Christ. Although "the Gentiles" or "the heathen" aren't specifically named here, Jesus did tell us exactly who they were elsewhere.
We read:
Matthew chapter 20
[18] Behold, we go up to Jerusalem; and the Son of man shall be betrayed unto the chief priests and unto the scribes, and they shall condemn him to death,
[19] And shall deliver him to the Gentiles to mock, and to scourge, and to crucify him: and the third day he shall rise again.
Of course, "the Gentiles" who mocked, scourged, and crucified Jesus were the Roman soldiers.
With this information before us, let's turn back to Psalm 2 to get God's actual response to the same.
Psalm 2
[4] He that sitteth in the heavens shall laugh: the Lord shall have them in derision.
[5] Then shall he speak unto them in his wrath, and vex them in his sore displeasure.
[6] Yet have I set my king upon my holy hill of Zion.
God laughs at those who have joined hands together to crucify Christ, and then he derides them, and speaks unto them IN HIS WRATH, while vexing them IN HIS SORE DISPLEASURE.
Does that sound like "forgiveness" to you?
It doesn't sound the least bit like "forgiveness" to me.
God then goes on to tell these co-conspirators that Jesus will yet be his king upon his holy hill of Zion.
How can the Christ who they crucified yet be God's reigning king?
Well, we receive the correct answer to this question in the very next verse of this prophetic Messianic psalm.
We read:
Psalm 2
[7] I will declare the decree: the LORD hath said unto me, Thou art my Son; this day have I begotten thee.
Here is but one of several places in the Old Testament where we are privileged to listen in on a conversation between God the Father and Jesus Christ.
This is who is speaking to whom:
"I (Jesus) will declare the decree: the LORD (God the Father) hath said unto me (Jesus), Thou (Jesus) art my (God the Father's) Son; this day have I (God the Father) begotten thee (Jesus)." (Psalm 2:7).
Contrary to the unbiblical nonsense recorded in the Nicene Creed, Jesus Christ was "begotten" on the day ("this day") that he was raised from the dead, and this is how the crucified Christ could still be God's reigning king. Again, this is by no means my own "private interpretation, but rather the plain teaching of scripture.
We read:
Acts chapter 13
[26] Men and brethren, children of the stock of Abraham, and whosoever among you feareth God, to you is the word of this salvation sent.
[27] For they that dwell at Jerusalem, and their rulers, because they knew him not, nor yet the voices of the prophets which are read every sabbath day, they have fulfilled them in condemning him.
[28] And though they found no cause of death in him, yet desired they Pilate that he should be slain.
[29] And when they had fulfilled all that was written of him, they took him down from the tree, and laid him in a sepulchre.
[30] But God raised him from the dead:
[31] And he was seen many days of them which came up with him from Galilee to Jerusalem, who are his witnesses unto the people.
[32] And we declare unto you glad tidings, how that the promise which was made unto the fathers,
[33] God hath fulfilled the same unto us their children, in that he hath raised up Jesus again; as it is also written in the second psalm, Thou art my Son, this day have I begotten thee.
After addressing the ignorance of the people and their rulers in relation to Christ's crucifixion (vs. 27), Paul went on to declare unto his hearers the "glad tidings" or the gospel in relation to Christ's resurrection from the dead. While doing so, he cited Psalm 2:7, "Thou art my Son, this day have I begotten thee", because, again, "this day" was the day that Jesus was truly "begotten" or raised from the dead.
Did Paul tell his hearers that God had "forgiven" them of their ignorance?
No, he did not.
In fact, he went on to issue to them this stern warning:
Acts chapter 13
[40] Beware therefore, lest that come upon you, which is spoken of in the prophets;
[41] Behold, ye despisers, and wonder, and perish: for I work a work in your days, a work which ye shall in no wise believe, though a man declare it unto you.
Turning back to the second psalm, the conversation between Jesus and God the Father continues:
Psalm 2
[8] Ask of me, and I shall give thee the heathen for thine inheritance, and the uttermost parts of the earth for thy possession.
[9] Thou shalt break them with a rod of iron; thou shalt dash them in pieces like a potter's vessel.
Again, this is who is speaking to whom:
"Ask (Jesus is the one being told to "ask") of me (God the Father), and I (God the Father) shall give thee (Jesus) the heathen for thine (Jesus') inheritance, and the uttermost parts of the earth for thy (Jesus') possession. Thou (Jesus) shalt break them with a rod of iron; thou (Jesus) shalt dash them in pieces like a potter's vessel." (Psalm 2:8-9)
Once more, this is by no means my own "private interpretation", but rather the plain teaching of scripture.
Jesus said:
Revelation chapter 2
[24] But unto you I say, and unto the rest in Thyatira, as many as have not this doctrine, and which have not known the depths of Satan, as they speak; I will put upon you none other burden.
[25] But that which ye have already hold fast till I come.
[26] And he that overcometh, and keepeth my works unto the end, to him will I give power over the nations:
[27] And he shall rule them with a rod of iron; as the vessels of a potter shall they be broken to shivers: even as I received of my Father.
Jesus told those of the church in Thyatira that if they held fast, overcame, and kept his works unto the end, then he would give them power over the nations, and they would rule them with a rod of iron and as the vessels of a potter they would be broken to shivers, EVEN AS HE HAD RECEIVED OF HIS FATHER.
Well, where did Jesus receive the same of or from his Father?
He received it in Psalm 2:8-9, even as we previously read.
Finishing out Psalm 2, we read:
Psalm 2
[10] Be wise now therefore, O ye kings: be instructed, ye judges of the earth.
[11] Serve the LORD with fear, and rejoice with trembling.
[12] Kiss the Son, lest he be angry, and ye perish from the way, when his wrath is kindled but a little. Blessed are all they that put their trust in him.
In the light of everything we've already read ("therefore" - vs. 10), the kings and judges of the earth are instructed to serve the LORD with fear, and to rejoice with trembling. In other words, the crucified Christ is yet alive, and he will one day return to dash his enemies to pieces, and they need to be prepared for that day. With such being the case, they're further instructed to kiss the Son, or to make peace with Jesus, lest they perish from the way when HIS WRATH is kindled but a little.
Again, if they were already "forgiven" when Jesus prayed for them from the cross, then why the need for all of these warnings?
Anyhow, this is just another reason why I don't believe anyone was "forgiven" when Jesus prayed for them from the cross apart from genuine repentance on their own parts.