All railroad companies and warehouse operators operating in the cities provided for inspection by this chapter shall furnish ample and sufficient police protection to all their several terminal yards and terminal tracks to securely protect all cars containing commodities while the same are in their possession. They shall prohibit and restrain all unauthorized persons, whether under the guise of sweepers, or under any other pretext whatever, from entering or loitering in or about their railroad yards or tracks and from entering any car of commodities under their control, or removing commodities therefrom, and shall employ and detail such number of security guards as may be necessary for the purpose of carrying out the provisions of this section.