A US court has ruled files relating to the Duke of Sussex's US visa application must be made public within days.