Engineers know speed limits from published written sources and from being "qualified" or trained over the territory they operate. There is no "seat of the pants" operating like driving a car and just obeying signs along the way. The regular established speeds over a given territory are specified in employee timetables which have much more information than regular public timetables. Any changes in speeds that vary from the timetable are listed in train orders or bulletins which are issued to the crew before each trip that have the most up to date information about speed changes since the last timetable was issued. The crews study these orders before departure and recheck them constantly enroute. If a change in speed is needed once a train is already enroute, the dispatcher will relay the information via radio. Keep in mind that a given railroad crew only operates over certain territory over certain lines, usually not more than a couple hundred miles at most over a few routes...for example one group of crews only operate between Washington and New York and go nowhere else. They do not wander all over the country or all over the railroad like an over the road truck driver. Thus crews know every inch of their territory to the point they know every switch, signal and speed as well as they know their own home. As a additional aid, some railroads post speed limit signs along the way but they really are a backup as they can be vandalized or removed and thus can't be relied on alone. They are usefull in when knowing when a speed restriction on a tight curve ends and normal speed can be resumed. Long trains, especially freight trains, relay on a counter or odometer which the engineer constantly sets and resets to know when the end of the train has cleared a speed restriction...and of course crews are given the information on the precise length of their train. On those railroads that do post speed limit signs, sometimes you will see two numbers like 60/40 on a sign. The higher speed is for passenger trains and the lower speed is for freights.