Our study involves the decision-making problems that railway infrastructure managers face in a rail network with dedicated tracks and shared-use corridors. We will analyze the consolidation strategy for shared-use corridors, where the track serves passenger and freight trains. In the stochastic demand case, we will provide an analytical model for the railway infrastructure manager to compute the expected long-term profit using a consolidation system. We will pinpoint the different characteristics of passenger and freight trains, and analytically derive the optimum track allocation and consolidation time, together with the optimum price, in all such cases, using two different model structures, i.e., the additive and the multiplicative forms. We will extend our model further to consider the due-date requirements and volume incentives for railway operators. Our experiments will use realistic parameter values, based on the Dutch railway system.