The railroad by the act of requesting the appointment of any such railroad police officer shall be liable and responsible for all acts of such policeman while he is acting or purporting to act under the provisions of Sections 77-9-501 through 77-9-517 whether such action be authorized by said sections or not; further the railroad shall indemnify the State of Mississippi, the commissioner of public safety and any sheriff for any loss, costs, or expenses incurred by virtue of any act, deed, or omission committed by any such policeman while he is acting or purporting to act under the provisions of Sections 77-9-501 through 77-9-517 whether such act, deed, or omission is authorized by said sections or not.