Trains to/from Sheki
At the Baku train station, you can only buy one way tickets to Sheki. But the ticket booth at the station in Sheki is not open when you arrive in the early morning, so you can't buy a return ticket then... The station in Sheki is a 20 minutes drive away, 5 manat (one way) trip to town. So, you either have to come back out to the station later (and hope ticket booth is open), or arrive early for your train and hope for the best.
Beware: the train from Sheki to Baku now leaves at 21:15 NOT 22:00!
There are plenty of buses and they take about half the time as the train. There are also shared taxis in an emergency.
There is a nightly train to Balakan via Sheki. It leaves Baku at 10:20 pm (summer schedule). Arriving in Sheki at around 7, Qax around 9, Zaqatala around 11 and Balakan around 12. It cost 3 Manat for 3rd classб 4 manat fro 2nd class and 8 manat for 1st class.
You can book tickets up to 10 days in advance, but as of the moment there are no booking agencies, you need to go to the station yourself. Tickets to internatinal destinations are sold only to those who produce the original passport, no photocopies.