You can set your AI trains as well as the player to different service classes. These will change which lines the trains preferedly take and also which train can go first on a certain track if you route two trains over the same one.

priorities from highest to lowest are:

  1. Special (do not use)
  2. Light Engine
  3. Express passenger
  4. Stopping passenger
  5. High speed freight
  6. Express freight
  7. Standard freight
  8. Low speed freight
  9. Other freight
  10. Empty stock
  11. International

When in route editing mode you can view which tracks are defined with which priority by pressing the spacebar once. There are different modes available you can cycle through with your spacebar.