A man was arrested at a Northern Ireland train station after allegedly impersonating a police officer and brandishing an imitation firearm.