Optimal driving strategies for a train journey with non-zero track gradient and speed limits