Longevity remains one of the key issues for Lithium-ion (Li-ion) battery technology. On-board Intelligent Battery Management Systems (BMS) implement health-conscious control algorithms in order to increase battery lifetime while maintaining the performance. For such algorithms, the information on Remaining Useful Life (RUL) of the battery is crucial for optimizing the battery performance and ensuring minimal degradation. However, accurate prediction of RUL remains one of the most challenging tasks until this date. In this paper, we present an online RUL estimation scheme for Li-ion batteries, which is designed from a thermal perspective. The key novelty lies in (i) leveraging thermal dynamics to predict RUL and, (ii) developing a hierarchical estimation algorithm with provable convergence properties. The algorithm consists of three stages working in cascade. The first two stages estimate the core temperature, State-of-Charge (SOC) and battery capacity based on a combination of thermal and Coulombic SOC model. The third stage receives this capacity information and in turn identifies a capacity fade aging model. Finally, we estimate the RUL by predicting the battery capacity fade over the cycles utilizing the identified aging model. A combination of sliding mode observers and nonlinear least-squares algorithm is utilized for designing the estimators. Simulation results illustrate the performance of the proposed RUL estimation scheme.