Working under the assumption that there is no "group contract" then they are not entitled to withhold the deposit from you. If there are two separate contacts then there are two separate contractual liabilities under them.
If your daughter has contracted under the new tenancy then she will be bound to pay rent unless the property is unfit for human habitation (which would entitle her t terminate the contract). If you believe it was (unfit) then you should contact the local authority's environmental health department to request an inspection of the enviro/health standards there and if the house is a House Multiple Occupation then you should ask them to check the compliance with HMO legislation.
If the department finds it unfit for human habitation then you can terminate the tenancy (though you should certainly request this in writing from the department) and would not be liable for the rent.
If it is not unfit for human habitation then you will be liable for the rent until a replacement tenant is found. There is nothing to stop you finding a tenant to produce to the agency, www.gumtree.co.uk is fairly good for this purpose. The agency will no doubt charge some fees to the new tenant for replacing them on the tenancy and you may choose to cover these for the tenant as the lesser of two evils.
It would be the landlord/agency who would sue for the rent initially. Liability under tenancy agreements is joint and several meaning they can sue any/all of the tenants for the arrears. The other tenants would probably be able to sue your daughter in turn if action is taken against them.
Assuming there is no "group contract" you can probably issue against the tenant holding the deposit but you may wish to see if you can get a replacement sorted first. This, along with finding out whether the property is unfit for human habitation should be your focus first.
If this is useful please kindly click accept so that I may be rewarded for my time. It will be gratefully received and you will be free to ask follow up questions.