This paper proposes a novel localization algorithm for a UWB-embedded car key, by which its LOS(Line-of-Sight) or NLOS(Non-Line-of-Sight) condition can be identified based on the Random Forest model and hence its location can be precisely estimated. Most of existing studies utilize the method of analyzing data collected in the LOS environment and predicting the position of objects when they enter the NLOS environment. However, they do not work well in the cases of vehicular environments because it is not easy to collect those data. In this paper, we presented an algorithm to correct errors based on the reliability of measured distance information in each sensor by distinguishing the NLOS environment through the Random Forest model using distance information measured in real-time. According to the experimental results, the proposed algorithm have showed a high accuracy of 94.6% and very good perfomance in terms of localization error, compared to the well-known error correction algorithm, Kalman-Filter.