If any railway servant is in a state of intoxication while on duty 1*** and when the performance of any duty in such state is likely to endanger the safety of any person travelling on or being upon a railway, such railway servant shall be punishable with imprisonment for a term which may extend to one year, or with fine, or with both.