It has nothing to do with actual direction. Coach timetables and later train timetables in Victorian times used 'up' for coaches/trains going to London whether they were coming from Newcastle, Brighton or Cardiff. The idea was that the capital is the country's most important city and so one would go 'up' to it.
Thus, the up-lines were those taking trains towards London and the down-lines were those taking them away from there. If the line had nothing to do with London as such, the up-line was the one headed for the larger or more important destination.