Yikes, I don't know about border detentions. The right to representation attaches (generally) at the start of criminal proceedings, pursuant to the 6th Amend. Is a border detention a criminal proceeding? Probably it's just some sort of administrative function and so your rights are certainly much slimmer at this point.