I was not able to find train connection but on the pages of the central bus station in Ljubljana you can find buses that go to Trieste (local name in Slovenian: Trst).
This is much shorter trip than taking detours and taxis as suggested by Paola.
Here is a sample: Date 18.7.2012Departure TrstArrival LJUBLJANA AVTOBUSNA
POSTAJADeparture Arrival Duration km
14:00 16:15 2:15 106 18:20 20:20 2:00 80
travel.stackexchange.com/users/73/Toni Frankola
There is a railways (in fact even several) between Italy and Slovenia, but they only carry freight at the moment.
The main reason is that Trenitalia is not an easy company to cooperate with, and the Slovenian railways don't have the money to go on their own (like for example the German and Austrian railways have done)I have travelled from Ljubljana to Trieste when cross border trains were still running, but this was a few years ago.
Currently the options to get from Trieste to Ljubljana are:- Direct bus.
- Bus to Sezana and train from there.- Tram (it's quite an interesting tram actually) to Vila Oppicina.
Taxi to Sezana from there.
Then train.
www.bahn.de will give you info for trains from Sezana to Ljubljana.
www.autostazionetrieste.it has info about buses.
You can also go via Gorizia (and walk from the one station to the other)
but that's a bit roundabout.
Update:
Since the last timetable change there is again a train from Vila Opicina (above Trieste) to Ljubljana.
So the trip now involves using the tram,bus or a taxi to get to Vila Opicina, where you can now board the train again.
Lets hope this improves in the future.
travel.stackexchange.com/users/6047/Krist van Besien
Strange as it may seem because of the limited distance, the journey between Trieste and Ljubljana is rather tortuous and complicated, but there surely is a connection between Italy and Slovenia.
As you can find in this link , you go to Gorizia by train, then you need to catch a bus or a taxi to reach Nova Gorica in Slovenia, from where you will catch another train to Jesenice and finally to Ljubljana.
A different itinerary will take you to Gorizia by train and then to Nova Gorica by bus or taxi, then you take another train to Sezana, hence change to Divaca and finally to Ljubljana.
This way you have to catch a series of means of transport, but the whole journey should last only 5 hours.
I suppose that you could travel faster if you chose to travel by coach, but I couldn't find reliable information about this.
EDIT : I'm sorry, but the correct page disappears whenever I try to link it.
It is however to be found on www.reiseauskunft.bahn.de , then fill in the details of your request.
travel.stackexchange.com/users/2194/Paola
The official Swiss Train Company, called SBB , has a lot of connections from Triente to Ljubljana.
However, you have to change the train twice, and it is a rather long journey.
On the other hand there are frequent connections.
Typically, you have to change in Udine, Italy and Villach, Austria which is a ridiculous detour.
The fastest connection includes a bus connection (90 minutes between Udine and Villach, but there is also a train available, e.g. connection number 3, that takes a little bit longer).
After the timetable, I also included a Google Maps picture so that you can see the huge detour ;)
Unfortunately, I can't get an immediate price quote.
You have to either call them, or use the online form to enter your personal details
and then you will get a price quote in a few hours.
travel.stackexchange.com/users/693/RoflcoptrException
If you really want to travel by train but still want to travel less than a day, then take a bus from Trieste bus station to Sezana and then a train from Sezana to Ljubljana.
The train station in Sezana is right close to the bus station.
The alternative, and a longer option, is to take a bus to Koper (about 20km), and then a train from there to Ljubljana.
travel.stackexchange.com/users/2854/dArio
There is actually a train connection between both cities again since September 2018.
From
The Man in Seat 61 : A new twice-daily regional train started running between Trieste & Ljubljana from 9 September 2018, restoring rail travel between Italy and Slovenia after a gap of several years.
It's now the comfortable and civilised way between Venice, Trieste, Ljubljana and Zagreb.
You can check these times using www.bahn.de/en .
travel.stackexchange.com/users/57126/J0ANMM
Surprisingly enough, there is indeed no railway between Italy and Slovenia.
One can see that on the map of European railways provided by Interrail that even though the Italian and Slovene railways are very close to each other, they do not connect.
While I do not have a definitive reason, it might be because this is a former border of Yugoslavia.
An article on Wikipedia on Italy-Yugoslavia relations shows they were quite animated.
On the map, we can see that the cities of Gorizia, in Italy and Nova Gorica in Slovenia are pretty close, as well as Trieste is close to Sezana and Koper.
One can find on wikitravel a suggestion for a bus between Nova Gorica and Gorizia, a 10 minutes ride.
By the way, I am also surprised no one looked at a map when trying to answer this question.
travel.stackexchange.com/users/3044/Vince
My Italian part of my trip is almost over; currently enjoying Trieste.  I have been using the train around Italy but when I checked the Trenitalia website to see if a train left from Trieste to Ljubljana it says it does not know of any trains?  This does not make sense, surely there must be a train service from Italy to Slovenia?  http://www.trenitalia.com/cms/v/index.jsp?vgnextoid=ad1ce14114bc9110VgnVCM10000080a3e90aRCRD  If not does anyone know the best way to get from Trieste to Ljubljana?
How to get to Ljubljana (Slovenia) from Trieste (Italy) by Train?
travel.stackexchange.com
<trains><italy><slovenia>
travel.stackexchange.com/questions/8484
travel.stackexchange.com/users/1719/tomaytotomato
According to the Man in Seat 61:  A new twice-daily regional train started running between Trieste &  Ljubljana from 9 September 2018, restoring rail travel between Italy  and Slovenia after a gap of several years.  Prior to this, trains running between the two countries only carried freight. This journey is quite complicated despite the short distance, but the official Swiss Train Company, called SBB , now has a lot of connections between the two. It is also possible to take the bus to Sezana or Koper, then the train from there to Ljubljana. There is great debate about the availability of a train service from Trieste to Ljubljana. However, it appears the service has now been re-established and there are two trains a day. An alternative route is a bus to Sezena or Koper then a train to Ljubljana.
The railway connection between Ljubljana and Trieste has a complicated history, although it appears that the connection has now been re-established and there are two trains a day. An alternative to the direct train is to travel by bus from Trieste and pick up a train in Sezana or Koper.