Nova Gorica is connected to Ljubljana by both bus and train. I didn't take the train, but from what I saw on the schedules, its not a direct route and saves little time. The bus from Nova Gorica cost about 12 euro one way and was SO slow. We stopped in every inhabited village between NG and the border of its region. The scenary was beautiful but, if you're in a rush, this is definitely not for you. The last bus leaves at about 7:30 or 7:45 and gets to Ljubljana just before 10PM.
An optional way to reach Ljubljana from Italy is crossing, on foot, the border betwen Gorica and Nova Gorica. Then, you take a train to Ljubljana throught the Northen country.
You must change at Jesenice!
Car is definitely the way to do it. The areas I'm talking about are remote, and there is no more than one, maximum two buses leaving daily from Nova Gorica.
On foot! No doubt.