John 8:31-36 does not bear out that those who believed in Jesus were still slaves to sin.
Be sure to continue to read from verse 31 all the way through verse 59. Jesus clearly calls them out.
I believe that the people you are speaking about here were distinctly different from the people who had believed on Christ.
John 8:31 So Jesus was saying to
those Jews who had believed Him, “If you continue in My word, then you are truly My disciples; 32 and you will know the truth, and the truth will set you free.” 33
They answered Him, “We are Abraham’s descendants and have never been enslaved to anyone; how is it that You say, ‘You will become free’?”
(same group of people)
34 Jesus answered them, “Truly, truly I say to you, everyone who commits sin is a
slave of sin. 35 Now the slave does not remain in the house forever; the son does remain forever. 36 So if the Son sets you free, you really will be free. 37
I know that you are Abraham’s descendants; yet you are seeking to kill Me, because My word has no place in you. 38 I speak of the things which I have seen with My Father; therefore you also do the things which you heard from your father.”
39
They answered and said to Him, “Abraham is our father.” Jesus said to them, “If you are Abraham’s children, do the deeds of Abraham. 40 But as it is,
you are seeking to kill Me, a man who has told you the truth, which I heard from God; this Abraham did not do. 41
You are doing the deeds of your father.” They said to Him, “We were not born as a result of sexual immorality; we have one Father: God.” 42 Jesus said to them,
“If God were your Father, you would love Me, for I came forth from God and am here; for I have not even come on My own, but He sent Me. 43 Why do you not understand what I am saying? It is because you cannot listen to My word. 44
You are of your father the devil, and you want to do the desires of your father. He was a murderer from the beginning, and does not stand in the truth because there is no truth in him. Whenever he tells a lie, he speaks from his own nature, because he is a liar and the father of lies. 45 But because I say the truth, you do not believe Me. 46 Which one of you convicts Me of sin? If I speak truth, why do you not believe Me? 47
The one who is of God hears the words of God; for this reason you do not hear them, because you are not of God.”
48
The Jews answered and said to Him, “Do we not rightly say that You are a Samaritan, and You have a demon?” 49 Jesus answered, “I do not have a demon; on the contrary, I honor My Father, and you dishonor Me. 50 But I am not seeking My glory; there is One who seeks it, and judges. 51 Truly, truly I say to you, if anyone follows My word, he will never see death.” 52
The Jews said to Him, “Now we know that You have a demon. Abraham died, and the prophets as well; and yet You say, ‘If anyone follows My word, he will never taste of death.’ 53 You are not greater than our father Abraham, who died, are You? The prophets died too. Whom do You make Yourself out to be?” 54 Jesus answered, “If I glorify Myself, My glory is nothing; it is My Father who glorifies Me, of whom you say, ‘He is our God’; 55 and you have not come to know Him, but I know Him. And if I say that I do not know Him,
I will be a liar like you; but I do know Him, and I follow His word. 56 Your father Abraham was overjoyed that he would see My day, and he saw it and rejoiced.” 57 So the Jews said to Him, “You are not yet fifty years old, and You have seen Abraham?” 58 Jesus said to them, “Truly, truly I say to you, before Abraham was born, I am.” 59
Therefore they picked up stones to throw at Him, but Jesus hid Himself and left the temple grounds.
John 8:31 - “If you continue in My word, then you are truly My disciples." Those who don't continue in His word are not truly His disciples.
Case in point: they believed and yet they didn't believe?
There is a stage in the progress of belief in Jesus that "falls short of genuine or consummated belief resulting in salvation." In James 2:19, we see that the demons
believe "mental assent" that "there is one God," but they
do not believe in Christ unto salvation/have faith in/trust in/reliance in Jesus Christ for salvation. In other words, they
do not believe on the Lord Jesus Christ (Acts 16:31)
and are not saved. Their trust and reliance is in Satan (and not in Christ) as demonstrated by their rebellion in heaven and continuous evil works. *Take note that the same Greek word for believe "pisteuo" is used both in James 2:19 and Acts 16:31, so not all belief is exactly the same. So would you use the same logic for the demons in James 2:19? They believed and yet they didn't believe? What is the content that is believed? Not all belief is rooted in a regenerate heart and is unto salvation.