Despite recent advancements in prosthetic technology, lower-limb amputees often remain limited to passive prostheses, which leads to an asymmetric gait and increased energy expenditure. Developing active prostheses with effective control systems is important to improve mobility for these individuals. This study presents a machine-learning-based approach to classify five distinct locomotion tasks: ground-level walking (GWL), ramp ascent (RPA), ramp descent (RPD), stairs ascent (SSA), and stairs descent (SSD). The dataset comprises fused electromyographic (EMG) and inertial measurement unit (IMU) signals from twenty non-amputated and five transtibial amputated participants. EMG sensors were strategically positioned on the thigh muscles, while IMU sensors were placed on various leg segments. The performance of two classification algorithms, support vector machine (SVM) and long short-term memory (LSTM), were evaluated on segmented data. The results indicate that SVM models outperform LSTM models in accuracy, precision, and F1 score in the individual evaluation of amputee and non-amputee datasets for 80–20 and 50–50 data distributions. In the 80–20 distribution, an accuracy of 95.46% and 95.35% was obtained with SVM for non-amputees and amputees, respectively. An accuracy of 93.33% and 93.30% was obtained for non-amputees and amputees by using LSTM, respectively. LSTM models show more robustness and inter-population generalizability than SVM models when applying domain-adaptation techniques. Furthermore, the average classification latency for SVM and LSTM models was 19.84 ms and 37.07 ms, respectively, within acceptable limits for real-time applications. This study contributes to the field by comprehensively comparing SVM and LSTM classifiers for locomotion tasks, laying the foundation for the future development of real-time control systems for active transtibial prostheses.