There are works on the line in Serbia. You have to go by foot over the border between Serbia and Croatia or by bus (not included in the pass). Then with the train to a station before Novi Sad, and with the bus to the central station of Novi Sad from there trains run to Beograd Central and from there one train if I think right to Montenegro. Timetables only on the website of the Serbian railways or Montenegro.
Maybe the best idea is to use the bus till Novi Sad or Beograd.
@Angelo thanks for your reply. Do you know how I can get to Mostar and/or Greece from Montenegro?
From Mostar to Montenegro only by bus and From Greece to Montenegro only by bus via Albania or by rail to Serbia and Nord Macedonia and then by bus over the border. But please check the website of serbian railways, nord macedonia and Trainose in Greece if there are now trains or busses instead.
IN what used to be Yugoslavija (I hope you have learnt that @ school) there simply are NO trains over border for now. Rails have not been maintained since it fell apart and thus its long overdue. These shuffles with short trips on train then looking for a hard to find bus that may not even appear will only lead to frustrations and much longer trips. There are-google always helps for that-ample general Busbooking sites-use these just for what is there supposed to be and buy ticket only when there from counter/office. It may change by the day. Thus a railpass is of no value-IF there is a train and it really runs, then a ticket is very cheap.
If you want to reach TR-that is in summer possible again, but only via big detour via ROmania. GReece as for now not linked at all.
To come back from GR and by train-use ferry GR->ITaly. There are NO completely free ferries, whatever site will tell.