Thailand and China have agreed to jointly develop two rail lines in Thailand which could eventually link the two countries.