Any two or more counties may form a district for the purpose of requiring all persons confined in the county jails of such counties, under a final judgment of imprisonment rendered in a criminal action or proceeding, to perform labor on the public works or public highways in all or any of such counties, and to maintain for that purpose one or more joint county road camps in which such jail prisoners of any or all of said counties may work together.