POPLARVILLE, Miss. — With the lunch hour near and the temperature in the 80s, the only souls in sight outside the courthouse here were two men taking turns aiming a pressure washer’s nozzle at the steps of the building.

No lawyers. No police officers or jailers. No passers-by. Just two state prisoners, dressed in uniforms with thick stripes of green and white — trusties on work detail, a common sight across the South and many other parts of the country.

But by the time the summer ends, such work details, which provide services for local governments, will be overhauled here in Mississippi, the latest state to scale back work for inmates.

Although the programs were once regarded as sources of cheap — or free — labor for local governments, as well as employment for trusted inmates, officials in some states have concluded that they are too expensive to maintain. The effect is that while state prison systems can save money — $3.2 million a year in the case of Mississippi, according to state officials — many local governments are straining to find ways to replace the labor.