Legal battle to save A&E department