When you are on the rail section, let go of the arrow keys and only use the straife and jump keys. And when you hit a wall, you can jump right after it to ignore the stun. Took me ages to figure that out. Then just practice the timing.