Complex sentence: Their primary role was assisting the army with fortification duties and digging anti-tank ditches, but would as the shortage of manpower became severe be used as front line infantry, most often in urban settings.
Split into simpler sentences: Their primary role was assisting the army with fortification duties and digging anti-tank ditches. As the shortage of manpower became severe, they were used as front line infantry, most often in urban settings.