John needs some confirmation.
18 The disciples of John reported all these things to him. And John, 19 calling two of his disciples to him, sent them to the Lord, saying, “Are you the one who is to come, or shall we look for another?” 20 And when the men had come to him, they said, “John the Baptist has sent us to you, saying, ‘Are you the one who is to come, or shall we look for another?’” 21 In that hour he healed many people of diseases and plagues and evil spirits, and on many who were blind he bestowed sight. 22 And he answered them, “Go and tell John what you have seen and heard: the blind receive their sight, the lame walk, lepers are cleansed, and the deaf hear, the dead are raised up, the poor have good news preached to them.
In Luke 4 Jesus says this...
“The Spirit of the Lord is upon me, because he has anointed me to proclaim good news to the poor. He has sent me to proclaim liberty to the captives and recovering of sight to the blind, to set at liberty those who are oppressed,
Most of this comes from Isaiah 61
The Spirit of the Lord God is upon me, because the Lord has anointed me to bring good news to the poor; he has sent me to bind up the brokenhearted, to proclaim liberty to the captives, and the opening of the prison to those who are bound; 2 to proclaim the year of the Lord's favor, and the day of vengeance of our God; to comfort all who mourn;
So why doesn't Jesus tell John that the captives are being set free? Ultimately, John will be free. But before that, he will be beheaded. This is tough stuff.
Jesus does encourage John by reminding him of the prophecies fulfilled. But John must still walk through this valley.
Jon Bloom has some good commentary on this passage. If you get a chance to read it, I think it will encourage you.