Guard posted next to railway (6)
I believe the answer is:
sentry
'guard' is the definition.
(sentry is a kind of guard)
'posted next to railway' is the wordplay.
'posted' becomes 'sent' ('send' can be a synonym of 'post').
'next to' means one lot of letters go next to another.
'railway' becomes 'ry' (abbreviation for railway).
'sent'+'ry'='SENTRY'
(Other definitions for sentry that I've seen before include "One posted on guard" , "Guard on watch" , "Sentinel, watch" , "One keeps guard" , "Mil. guard" .)