A writer takes a weeklong journey, from the island city-state to the Thai capital, in the final days of a historic rail connection.