The factors that led to the end of trans-Saharan trade routes are:
Civil unrest due to collapse of the Songhay Empire, the Timbuktu, by the Morracans in 1591
The extreme desert conditions like extreme climates, excessive heat, lack of water and food etc made the travel logistics very tough. This made people opt for other transport systems
Huge advancements made in maritime travel
Exploration of West African trade routes
Economic, political and social changes which led to the end of trans-Saharan trade routes