In all cases where application is made to the governing or legislative body of a city or city and county for permission and authority to lay railroad tracks through streets or public highways of any city or city and county, the authorities before granting such permission and authority, in addition to the terms and restrictions which they are by law authorized to impose shall exact and require from the persons or corporation asking such permission and authority, as a condition precedent to the granting of permission, a satisfactory promise and undertaking to permit and allow mail carriers in the employ of the United States Government, at all times while engaged in the actual discharge of duty, to ride on the cars of such railroad without paying any sum of money whatever for fare or otherwise. All such permissions and franchises shall be subject to all other provisions of the laws of this State applicable to street railroads in general, and subject to regulations from city or city and county authorities.