The point of foxholes and trenches is primarily to protect against artillery and mortars. In the game, the best way to clear foxholes and trenches is by tank fire, followed by small arms and machineguns from less than 300 metres. (if you have 4.0 installed, a few mortar rounds will make the troops leave their foxholes, but that's another discussion).