In Southern India, Dhoti is worn in entire deccan by older people, in nothern India, rural people are still in dhoti. Lungi is more prevalent is south of telangana. I think Kosta and Rayalseema people wear more lungis than dhotis.
Origin of Dhoti is vedic civilization but no idea about Lungi