score:1
This depends on what you mean by a long time and precisely which country you are interested in. Fortunately the Man in Seat 16 has already done the research for you.
https://www.seat61.com/international-trains/trains-from-Krakow.htm
So you have a choice of two day-time trains a day from KrakΓ³v to Lviv and Kyiv in Ukraine if that is your specific destination. There is also a sleeper from Warsaw.