As far as i know its generally up towards a city/down away from it. Hence Merseyrails Chester line which is classed as the Down Chester coming from Liverpool then changes to the Up Birkenhead line at Hooton as it gets closer to Chester.
No, that's not the reason. I think the logic goes like this:
The initial line was the Chester & Birkenhead which was Up towards Chester (and Euston) all the way from Woodside to Chester.
It's called the Up
Birkenhead because the route was later called the Birkenhead Railway or Birkenhead Joint (or the Birkenhead, Lancashire & Cheshire Junction to give it its grandest title!).
Separately the Mersey Railway started from Hamilton Square with Up towards Liverpool, and this line extended to Rock Ferry eventually with the southbound line called the Down Rock Ferry.
After rationalisation and electrification the "Mersey" tracks were merged with the "Birkenhead" tracks at Rock Ferry and the previous Up line south from Rock Ferry was renamed Down Chester as far as Hooton, but left as before onwards to Chester.
So you have the strange setup of travelling on the Down Chester from Hamilton Square to Hooton, which becomes the Up Birkenhead there!
This isn't helped by the dog-leg at Hooton, which is the remains of the former 4-track layout.
Originally the fast lines were in the middle and the slow outside, but when they reduced it to two tracks, they chose the western pair of tracks from Rock Ferry to Hooton, and the eastern pair from Hooton to Ledsham Jn (where it reduced to two tracks onwards to Chester).
Actually I don't think there's much logic in naming lines generally, apart from the Up/Down bit. It's really just so signallers have a ready means of telling the lines apart for train movements.
Most simple layouts just have names like "Up Main" or "Down Branch".
There are some odd line designations, possibly the oddest being
Up/Down Poplar next to Acton Main Line out of Paddington, leading to Acton Wells on the North London Line.
It's all of 49 chains long, but it provided the link for GW trains to work over the NLR to reach the docks 10 miles away at ... Poplar!