To solve the rail puzzle in 8 – Partners in Uncharted: The Lost Legacy pull the car backwards past the switch. Turn the switch and then push the cart forwards until you can get through the wall.
When you are back near the tracks again pull the cart back up the slope, change the switch and push the cart back to where it started.