In John 8:2 Jesus comes to the temple courtyard and starts teaching:
Early in the morning he came again to the temple. All the people came to him, and he sat down and taught them. (8:2 ESV)
Many people came to Jesus to hear him speak. But then some of the Jewish leaders also come with ulterior motives. The scribes and Pharisees wanted to trap Jesus with a difficult question:
The scribes and the Pharisees brought a woman ... Now in the Law, Moses commanded us to stone such women. So what do you say?” 6 This they said to test him, that they might have some charge to bring against him. (8:3-6)
After a break in the story, we read:
Again Jesus spoke to them, saying, “I am the light of the world. Whoever follows me will not walk in darkness, but will have the light of life.” 13 So the Pharisees said to him, “You are bearing witness about yourself; your testimony is not true.” (8:12-13)
Jesus is speaking to "them" which must be the whole crowd. The Pharisees who stand close around Jesus attacks him again. The following verses (14-19) is a dispute between these Pharisees and Jesus. After an author comment by John, Jesus continues the discussion with the Pharisees:
So he said to them again, “I am going away, and you will seek me, and you will die in your sin. Where I am going, you cannot come.” 22 So the Jews said, “Will he kill himself, since he says, ‘Where I am going, you cannot come’?” 23 He said to them, “You are from below; I am from above. You are of this world; I am not of this world. 24 I told you that you would die in your sins, for unless you believe that I am he you will die in your sins.” (8:21-24)
The "them" here must be the opposing and unbelieving Pharisees, since all of this is a heated dispute between them and Jesus.
After this part of the dispute, John makes a comment about the common people who had been listening:
As he was saying these things, many believed in him. (8:30)
The "many" here can hardly be the Pharisees, but many of the common people. Jesus continues, this time speaking to these people who have believed:
So Jesus said to the Jews who had believed him, “If you abide in my word, you are truly my disciples, 32 and you will know the truth, and the truth will set you free.” (8:31-32)
Quite often the word "Jews" in John refers to the hostile Jewish leaders, but not here, as it is clarified by the relative clause "who had believed". Jesus encourages them to continue to follow him, listen to his words and obey them. Then we read in verse 33:
They answered him, “We are offspring of Abraham and have never been enslaved to anyone. How is it that you say, ‘You will become free’? (8:33)
Who are "they"? Is it the people who have just heard Jesus say to them "the truth will set you free," or is it the Pharisees who jump in and respond to words not spoken to them?