I interpret the OP question to actually be two questions.
1. 5 cars essential to a work train
2.) 5 cars essential to a freight train.
To answer question one; it depends the era being modeled and on the type of work train ... wreck train ... tie and rail replacement train, general MOW work train that cleans up debris, clears culverts, ... weed sprayer train, ... or snow removal train. Most of these work trains would share some common cars ( ie: gondola, flat, and box cars ) while other cars would be job specific for the purpose of that train.
Again it depends on the era being modeled ( if any ) and the needs of your specific railroad. I don't want to impose my opinion on others. These are the cars I have ( and additional cars as well ) which comprise my work trains since I model the transition era 1946 - 1959/60.
To answer question two; the most common freight cars .. boxcar ... flat car .., gondola ... tank car. Of course the 6th common type of freight car being the hopper in both covered and open forms.
I've posted some photos of work train equipment on The Free State Junction Railway.
Big Hook for wreck trains and other types of heavy lifting. ![96E7C6E1-8EB7-424B-A54D-C29FDCA88739 96E7C6E1-8EB7-424B-A54D-C29FDCA88739](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528365/fodoid/169515031301528350/imageType/MEDIUM/inlineImage/true/96E7C6E1-8EB7-424B-A54D-C29FDCA88739.jpeg)
Gondola car for carrying ties, booms, rails, blocking for the Big Hook, and other MOW equipment and heavy tools.
![B9646AF9-3D10-4740-BCE9-505D47B451D1_1_201_a B9646AF9-3D10-4740-BCE9-505D47B451D1_1_201_a](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528366/fodoid/169515031301528351/imageType/MEDIUM/inlineImage/true/B9646AF9-3D10-4740-BCE9-505D47B451D1_1_201_a.jpeg)
A short MOW train used for cleaning up debris alongside the track. A work caboose brings up the rear. ![IMG_1932 IMG_1932](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528367/fodoid/169515031301528352/imageType/MEDIUM/inlineImage/true/IMG_1932.JPG)
Tool and materials cars can have a multitude of purposes ... storage, machine/carpentry/electrical shop, office, bunk car for MOW workers, kitchen car. ![IMG_3187 IMG_3187](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528370/fodoid/169515031301528354/imageType/MEDIUM/inlineImage/true/IMG_3187.JPG)
Crane car with gondola being used as cradle for the boom. I do have a crane tender but no photos of it. A work caboose brings up the rear. ![0E48C1D2-1E30-435A-84FD-E53B16DBDDA8 0E48C1D2-1E30-435A-84FD-E53B16DBDDA8](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528372/fodoid/169515031301528356/imageType/MEDIUM/inlineImage/true/0E48C1D2-1E30-435A-84FD-E53B16DBDDA8.jpeg)
Snow removal trains are usually pushing a plow of one kind or another. Here is a flanger pushing snow. In summer months the flanger can be used to spread ballast on newly laid rail/ties.
Rotary snow plow for those really pounding storms that leave mega depths of snow to deep for a flanger to push away.
![9D8ADE7A-C164-4169-A0BC-29BB658C5241 9D8ADE7A-C164-4169-A0BC-29BB658C5241](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528374/fodoid/169515031301528357/imageType/MEDIUM/inlineImage/true/9D8ADE7A-C164-4169-A0BC-29BB658C5241.jpeg)
Jet powered snow blower for blowing snow from switches. ( this car may be a stretch beyond my modeling era but I do like it ) ![6B88C8FA-494A-44EF-8DB9-B30A62E9F659 6B88C8FA-494A-44EF-8DB9-B30A62E9F659](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528371/fodoid/169515031301528355/imageType/MEDIUM/inlineImage/true/6B88C8FA-494A-44EF-8DB9-B30A62E9F659.jpeg)
A welding car. ![F0136CC1-47C3-489F-899F-91DCB8BBFC82 F0136CC1-47C3-489F-899F-91DCB8BBFC82](https://ogrforum.ogaugerr.com/fileSendAction/fcType/0/fcOid/169374064529749915/filePointer/169515031301528376/fodoid/169515031301528361/imageType/MEDIUM/inlineImage/true/F0136CC1-47C3-489F-899F-91DCB8BBFC82.jpeg)