To detain is an authority figure preventing you from leaving.
To delay is to impose a wait for some reason.
The airline can delay my departure. The airport security can detain me for trying to carry a forbidden item through the security screening.
- For Teachers