As the comment above indicates, the Roman army before Julius Caesar's time seems to have had a dedicated engineer corps, but this group would also be expected to fight if necessary. From Julius Caesar's rule onward, the Roman army retained a dedicated engineering officer or senior engineer called the Praefectus Fabrum, who could call upon specially trained or skilled legionaries to lead troops in construction tasks, which included the creation of roads, fortifications, siege engines and certain weapons.
Because Roman Army doctrine called for fortified camps to be constructed at the end of every day's march, which included defensive works, every legionnaire and auxiliary became, over time, an engineer by default. An interesting result of having most troops engage in building activities is discipline: busy troops, tired from marching and building, were less likely to mutiny, a constant threat in the politically-charged atmosphere in almost every Roman legion.