Acts 16:37 - 39

"But Paul said to the officers: 'They beat us publicly without a trial, even though we are Roman citizens, and threw us into prison. And now do they want to get rid of us quietly? No! Let them come themselves and escort us out.' The officers reported this to the magistrates, and when they heard that Paul and Silas were Roman citizens, they were alarmed. They came to appease them and escorted them from the prison, requesting them to leave the city." NIV translation

We might wonder why Paul didn't simply keep his mouth shut and leave. I believe the simple reason is that Paul wanted the people to see the magistrates personally releasing them. His reason? It demonstrated that God is in control and not a mob or a bunch of politicians.

Acts 16:40

"After Paul and Silas came out of the prison, they went to Lydia's house, where they met with the brothers and sisters and encouraged them. Then they left." NIV translation

Once again, we see that Paul used what happened to him to strengthen the local believers. He went and shared the story (testimony) with the believers at Lydia's house. They would have been encouraged by the fact that the situation that looked so hopeless just a day before was used to bring a family to a saving faith in Jesus Christ.