If we compare regular automatic riflemen with snipers, machine gun operators, mortar operators and other roles, then which of them would have a higher chance to survive a battle?
All I could find are survival rates of US army vs US marines, but there’s a million roles in each, so those stats aren’t saying much, plus US soldiers probably have a higher survival rate by default than soldiers of most other countries in the world that don’t have comparable equipment, training and organization.
Your question is unanswerable when you account for incoming artillery, CAS, grenades, landmines, IEDs, etc.–non-descriminatory/area effect weapons and tactics that don’t care what your MOS is, so long as they’re dead.
The OP may come back with, “but I meant firefight,” to which I counter there is no such thing anymore as a ‘pure firefight.’ If you’re not using dynamic capabilities in an ‘engagement’ (aka if you’re not “fighting dirty against the enemy”), you’re doing it wrong. The side that leverages those other abilities will gain the upper hand.
Tripler
I also submit: snipers do not engage in “firefights,” they specifically avoid them.
Generally speaking, in defensive combat the simple rifleman is more likely to survive. Automatic high-caliber weapons like machine guns are prime targets, as are mortar pits. While it’s true that the modern rifleman has the capability to fire on full auto, fire discipline demands that he not do that in most circumstances. Of course, incoming artillery negates all that, as everyone is cannon fodder.
Most of your question makes it sound like you’re inquiring about light infantry in a medium or high intensity engagement. Here’s the organization table of a US Army Light Infantry Rifle Company.
The safest group in the rifle company is going to be the headquarters section which would hopefully not be directly engaging with the enemy. After that, it’s going to be the squads or platoons doing security - basically guarding the flanks and rear. However, that role rotates, so it’s only temporarily safe. Next safest - I’m going to disagree with Chefguy - is the mortar section. If possible, they’re going to have terrain features between them and the enemy so they won’t be subject to direct fire. Sure, they could be subject to counter-battery fire, but that’s if they’re spotted, and the mortar section is going to do their best to remain concealed.
Beyond that, it’s arguable whether being in a weapons squad or a rifle squad is more dangerous. The weapons squad is less likely to be running towards the enemy in an attack, but they also may be the ones to open an attack. And they’ve got the noisiest weapons in the company. On defence, they might be in an overwatch position, but they also could be placed at a key point on the perimeter.
Possibly, the OP was referring to a designated marksman when he used the word sniper. Basically, for infantry squads operating in open terrain, a rifleman who is a good shot receives extra training and is issued with a more accurate rifle than the standard infantry one. He then becomes the designated soldier for shooting at distant enemy targets. However, except for the added role, he still serves as a member of the rifle squad and takes part in regular operations. It’s probably slightly more dangerous than being an ordinary squad member since he’ll occasionally be the only one firing at an enemy, but it’s not like he’s going out alone or with just a spotter. It’s just that if the squad has an opportunity at a distant target, he’s the one who’ll get assigned to shoot at that target.