Judge tells US to pay costs of reuniting immigrant families