Yes, Archie will inevitably be out of detention before the end of the third season.
He’s bound to have some allies thanks to the imprisoned Serpents that Jughead promised, but the promo for the next episode reveals that he’s cruising for a bruising in juvenile detention.
Riverdale surely would not have sent Archie to juvenile detention for no reason, however, and his incarceration could mean that he meets somebody very important during his stint behind bars.
In fact, I’d put my money on him getting his walking papers by the end of the midseason finale.