Students 'trapped' in halls of residence