Nothing in this chapter shall apply to the running or operating of locomotives or motor power cars to and from trains at terminals by hostlers or of steam locomotives or motive power cars to and from engine houses or to the doing of work on steam locomotives or motive power cars at shops or engine-houses.