The serious cases of urinating in public, showing your privates where other people are around you and can see, is an offence under the Sexual Offences Act 2003. However, I would see it as a public order offence.
Never accept a caution (if you are innocent), no matter how much of a hurry you are in. Cautions may seem the quick way, but could affect future employment/insurance etc. They aren't criminal convictions but do go on your police record.
Why did you not ask a member of the rail staff to unlock the toilet?
I woudn't see a caution affecting joining the RAF. I would be honest in any application you complete, giving full details. If you don't you could be rejected when they find out.