From what I can gather at the moment Hungary is effectively closed off to all passengers to/from Schengen countries without passing through border checkpoints.
Trains between Croatia and Hungary are disrupted by the looks of it although Croatia is not in Schengen. What is happening with the trains in Dubrovnik as given its location and the fact that its an exclave.
I don't think there have been trains in Dubrovnik for years (wasn't it a branch of the JZ narrow gauge?) Ploce is the nearest. Doubt if the present crisis makes much difference there....