The best is to turn off the device or hold power button - "lockdown". This puts your device in BFU "before first unlock" state that put your data encrypted at rest, fully protected by the Titan M2 security chip. If they try to modify the OS you can immediatley after the passage run Auditor via a supported device or via the remote attestation service. https://attestation.app
Before getting close to the borders, put the phone's auto reboot to a low value, like 30 minutes. Even if they snatch it from you it will within that time period put the data at rest after the reboot.
Make sure you put the Allow USB peripheral option to "only when unlocked", and of course have Developer Options disabled.
I'm curious, if it is US state borders you are takling about, are they even allowed by law to do this?
If you suspect you may be victim of coercion you may best take the safe approach and reset the phone beforehand, and when you arrive at your destination, download your backup from a encrypted connection.