There was another line from Trieste port up to Hrpelje and Divaca for Ljubljana, K.u.K Staatsbahn (austrian state/empire railways) breaking the Südbahn (private company) monopoly I think. Now a nice bike track.
First thing to clarify is that "KuK" (for 'Kaiser- und Königreiches', Imperial and Royal) signified 'Empire of Austria and Kingdom of Hungary' and was the abbreviation for (the few) institutions common to both halves of the dual monarchy - and railways were not. For the non-Hungarian half of the Empire (it only became officially referred to as 'Austrian' in I think 1915, I forget how it was before then), the abbreviation was "k.k." (kaiserlich-königlichen, referring to the Emperor of Austria and King of Bohemia), so the (imperial) state railways were the kkStB (k.k. Staatsbahnen), becaming the k.k. österreichische Staatsbahnen in 1915. (Hungarian institutions, for the other half of the dual monarchy, used a single k for kiraly (royal in Hungarian), indicating kingdom of Hungary)
The line from TS Sant Andrea/Campomarzio to Erpelle/Hrpelje was built (1887) as a branch off the kkStB's Istrian line, from Divaca (where it branched off the SB (Südbahn) mainline) to Pula, and was closed in 1959, now (as stated) a bike track.
The kkStB later built - at the urging of Bohemian industrialists, to break the SB monopoly - a second line to Trieste, the Transalpina/Wocheinerbahn/Bohinjski Praga, opened in 1906, from TS Sant Andrea/Campomarzio to Jesenice and points north - one of the world's tragic main lines, as post war border changes split it up, destroying its intended role (though I understand under the EU there are projects to reverse this). This is the line from Campomarzio up to Villa Opicina.