Thousands of immigrant children on verge of losing legal representation