Thanks to all who responded. I think we’ll take the train. How far in advance would you suggest we buy out tickets and what website would you recommend?
It's better to continue in your previous thread instead of starting a new one.
But, buy them as soon as your travel schedule is set. They will only get more expensive. Buy them from www.oebb.at
Here are the very detailed instructions from the Man in Seat 61 website for this journey - https://www.seat61.com/international-trains/trains-from-Ljubljana.htm#Ljubljana-Vienna
Of course the longer you wait, the more expensive the ticket.