Having been robbed many times, including a kidnapping I can say that your logical thinking will go out of the window because of the nerves. I would find it difficult to remember a duress password and wouldn't trust myself with evaluating the situation properly to make the call whether to use it or not. I'd rather have an after-robbery mechanism to lock my phone once I am safe.
When assaulted, just cooperate.