Ridesharing, that is, the problem of finding parts of routes that can be shared by several travelers with different points of departure and destinations, is a complex, multiagent decision-making problem. The problem has been widely studied but only for the case of ridesharing using freely moving vehicles not bound to fixed routes and/or schedules-ridesharing on timetabled public transport services has not been previously considered. In this article, we address this problem and propose a solution employing strategic multiagent planning that guarantees that for any shared journey plan found, each individual is better off taking the shared ride rather than traveling alone, thus providing a clear incentive to participate in it. We evaluate the proposed solution on real-world scenarios in terms of the algorithm's scalability and the ability to address the inherent trade-off between cost savings and the prolongation of journey duration. The results show that under a wide range of circumstances our algorithm finds attractive shared journey plans. In addition to serving as a basis for traveler-oriented ridesharing service, our system allows stakeholders to determine appropriate pricing policies to incentivize group travel and to predict the effects of potential service changes.