If the ascent to the monastery is planned on the Cremallera funicular, then it makes sense to use a combined Trans Montserrat ticket (for example, at the Placa d'Espanya railway station). Using this FGC train ticket, you need to get to Aeri de Montserrat station, and then transfer to the Cremallera cogwheel railway carriage.