Updated 17 February 2016
There is daily overnight train service between Azerbaijan and Georgian capitals. The train departs from Baku for Tbilisi at approximately 20:30 and scheduled to arrive 16 hours later at around 11:00 am next day (there is one hour difference between the two countries). The cost is around $80 USD (55 AZN) for 1st class ticket and about half for 2nd class ticket. A daily overnight train from Tbilisi to Baku departs usually at 17.00 and arrives to Baku at 8.00 am next morning. Train might be pretty full and very hot but quite confortable.
To buy train tickets in Baku, the train station is next to the 28 May metro station. Look for a doorway marked "Kasse" to buy tickets. The trains are behind that area, you have to go around to reach them. You can board the train one hour before departure. Buy plenty of food and drinks as you can purchase neither on board (there is a supermarket in the shopping mall next to the KFC). Be ready that conductor would hardly speak any English but they will show you your compartment and will give you bedding, which is included in the ticket price. The train looks rather old from the outside but inside its quite new and even has a flat screen TV with Russian channels and two cameras showing the path through the wagon (sounds silly but rather convenient for the border controls and nightly walks to the toilet).
Be prepared to spend a great deal of time at Azerbaijan/Georgia border. Border crossing lasts about 1.5 hours for both sides. Border controls on the Azeri side is at about 8:00 the next morning.
The procedure is quite straightforward. First the customs official appears, collects the declaration and checks your luggage. A bit later the border officials will come and collect passports of all the passengers. A bit later passengers might be asked to go to another compartment where the boarder officials sit. They will ask you some questions (like the reason to come, what you did, and so on...), usual routine. After that they will stamp your passports and let you go.
Georgian customs is pretty much like the Azeri counterparts. You will be given a customs declaration by the conductor. Then border officials will again collect your passports and return them some 30 minutes later. Border procedures take about one hour on each side with 20 minutes travel in between.
Then it takes another 45 minutes to Tbilisi.
At the two-hour stop entering Georgia, taxi drivers mass outside the train offering rides into Tbilisi. Good bargainers can catch a ride for about 35 lari and arrive in the city by 10:00 or earlier instead of at the scheduled 11:00.
Alternatively, 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 exit at Balakan and cross the border in the morning. Plenty of taxis & buses available at Georgina side of the border that will take you to Tbilisi (1.5 hours drive).
The train to Baku from Tbilisi (2nd/1st-class 70/139 GEL (50 Euros), 14 hours) leaves at 5.15pm daily. Given the shortage of road transport from Tbilisi to Azerbaijan, this is the most convenient way to get to Baku and to stops en route such as Gəncə. The reverse direction train from Baku to Tbilisi is also liable to serious delays, with perhaps a couple of hours at the Georgian border post and the same at the Azeri border. Leaving Baku daily at 20.35, it takes around 15 hours for 549km, and fares start at about US$20. About 45mins into the trip, expect to have a lengthy stop at Gardabani where your passsports will be taken for inspection and returned once train leave the station. Then you continue to a town just across the border called Böyük Kesik. It is here that the Azerbaijan officials board the train.
NOTE: The Russian land borders with both Azerbaijan and Georgia are now open to foreigners and they can freely travel both by train and buses). So far there is actually only one train a week between Azerbaijan and Russia. It is the Baku - Moscow train leaving Baku on Thursdays at 00:30 and arriving to Astrahan next evening at 20:55. You can check the schedule on the Russian Railways website, but the ticket can't be booked on the website.
Important information on visa: If you're going to vizit Azerbaijan check the latest information of visa regime here >>>. Regularly updated data, helpful advice and expert guidance from licensed travel agency. If you have any questions, please do not hesitate to contact us.