The problem of routing trains through railway junctions is an integral part of railway operations. Large junctions are highly interconnected networks of track where multiple railway lines merge, intersect, and split. The number of possible routings makes this a very complicated problem. We show how the problem can be formulated as a set-packing model with a resource-based constraint system. We prove that this formulation is tighter than the conventional node-packing model, and develop a branch-and-price algorithm that exploits the structure of the set-packing model. A discussion of the variable generation phase, as well as a pricing routine in which these variables are represented by tree structures, is also described. Computational experiments on 25 random timetables show this to be an efficient approach.