Yes, there are real life police officers sitting in those cars in the construction zones. It is an off-duty assignment, and they are paid hourly by the construction contractor, so it is not actually a case of on-duty personnel being assigned to sit in the construction zone. The vehicles and gas are all supplied by the contractor as well, so your city is not paying to staff the construction zones. (Although, realistically, your tax dollars are still paying for it anyway, because all the road construction is being funded via federal stimulus grants)
The main purpose of the officers, as already mentioned, is to provide a physical deterrent and increase safety. They also assist by completing reports for any incidents that happen in the construction zone, thus reducing the resource strain for on-duty officers. When you say that you saw a construction worker sitting in the police vehicle, what you probably actually saw was an officer wearing a safety vest over his uniform, which at quick glance would look just like a construction worker... only armed and grizzled.