京都行き電車 is a compound noun which consists of two nouns,
”京都行き” , a noun made from a verb, and ”電車", a noun.
”行き” is a 連用形(RENYOUKEI) of a verb "行く“ (It is not a stem. The stem of 行く(IKU) is "IK")
連用形 is often used as a noun.
※ The structure is same as "駆け込み乗車“, which consists of 駆け込み(かけこみ)and 乗車(じょうしゃ)
※ 京都行き is also a combound noun.