Rail is one of the most energy efficient and economical modes of transportation amongst many. Regular inspection of railway track health is essential for ensuring robust and secure train operations. Investigations and delayed discovery pose a serious risk to the safe functioning of rail transportation. The traditional method of manually examining the rail track using a railway cart is both inefficient and susceptible to mistakes and bias. It is imperative to automate inspection in order to avert catastrophes and save countless lives particularly in zones where train accidents are numerous. The purpose of this research is to develop an Internet of Things (IoT)-based autonomous railway track fault detection system to enhance the existing railway cart system in order to address the aforementioned issues. In addition to data collection on Pakistani railway lines, this work contributes significantly to railway track fault identification and classification based on acoustic analysis, as well as fault localization. Due to their frequency of occurrences, six types of track's faults were first targeted: wheel burnt, loose nuts and bolts, crash sleeper, creep, low joint, and point and crossing. Support vector machines, logistic regression, random forest, extra tree classifier, decision tree classifier, multilayer perceptron and ensemble with hard and soft voting were among the machine learning methods used. The results indicate that acoustic data can successfully assist in discriminating the track defects and localizing the defects in real time. The results show that MLP achieved the best results, with an accuracy of 98.4 percent.