The board of supervisors of a county may provide a ward of the juvenile court engaged in rehabilitative work without pay, under an assignment by order of the juvenile court to a work project in a county department, with workers’ compensation benefits for injuries sustained while performing such rehabilitative work, in accordance with Section 3364.55 of the Labor Code.