A couple reasons for that…
First is that one end of the handrail attaches to the pilot, and the other end attaches to the cab. Both of these are separate pieces from the deck. Other reason is that it makes it easier to paint the handrails a different color from the rest of the engine. Also, it would make any potential repairs or replacement easier. So, um, three reasons.