Train pathing for stations with the same name

So according to the wiki, trains going to stations with the same name (for example a generic LOAD Station some people use), they will decide to which to go using the A* distance and respecting penalties.

At least until now, but now we have the priority system on top. So my question is, do they interact with each other, or does the priority system always beat the penalty and pathing distance system? And are train limits connect to them in any way?