The Apostles weren't accused of idolatry or even of teaching against Moses yet in Acts 5. The Sanhedrin would have to find false witnesses to bring those charges later. At this point, they were only accused of disagreeing with the Sadducees about resurrection.
And every day, in the temple and from house to house, they did not cease teaching and preaching that the Christ is Jesus.
Acts 5:42
Whatever charge the world brings against you, never stop obeying God and speaking of his goodness, no matter what anyone does or threatens.