This is from a book.
A traing is moving on earth. A ball is sitting at rest (relative to the train) on the floor of the train which is moving at constant velocity relative to a tree. If the contact between the ball and the train floor is frictionless, the ball receives no net external force. Observed from the tree-frame, the ball will continue to move at the same velocity as the train. Observed from the train-frame, the ball will continue to stay at rest. So the Law of Inertia holds in both the tree- and train-frames. They are both inertial frames.
But the earth itself rotates and it also orbits the sun. So, the earth is not inertial frame. So, why do we lable the train and the tree 'inertial frames'.