I definitely don't count airport time as visiting the country or city properly. I also wouldn't necessarily put a specific time limit on how long you'd have to spend in the country in order to "qualify" - different people spend their time doing different things in the same amount of time. I prefer to explain a bit about where I've been and what I've done in each location - e.g. I've actually lived in Edinburgh, whereas I've spent a total of 4 hours, all told, in Algeciras, and I didn't even do anything exciting. So, I'd say that it's also the quality of time you spend in a place, rather than the exact amount.
With regard to the train journeys you're thinking of undertaking, I have some insights that may interest you. My bf and I recently took a trip to Morocco from the UK, but since we didn't want to fly, we opted for trains and ferries instead and it worked out great. We could have managed to get there in less than 2 days, but we chose to spend some time in the inbetween destinations, so as to add to to the trip and not wear ourselves out. On the way there, we had a one night stop at Paris and 2 days and nights in Madrid. On the way back, another 2 days in Madrid and a 5-hour wait in Paris, which we spent mostly at the Musee d'Orsee. I'd never been to Paris before, so now I can say that I've been (even had time for the standard picture of me with the Eiffel Tower!), although I can't say that I've spent that much time there, or that I know the city well. Would you consider having similar stops at the places you'll be passing on your way to Estonia? From my own experience, I think it'll make the journey easier (but lengthier), and you'll add more variety to your travels.