The only high fibre food piggies need to keep poops normal and for weight gain (along with maintaining good gut and dental health) is hay, and lots of it.
You can also give some fresh grass (but only in small amounts to begin with if their digestive system isn’t used to it) as that also provides the nutrition their bodies need for health and weight maintenance. Of course at this time of year nutrition in grass is less and you must be careful not to feed any grass which is frozen.
Fresh Grass and Lawn Time - Tips for Avoiding Spring Time Deaths
Giving an extra piece of cucumber will help with the additional water intake.
The four safe daily veg they can have is lettuce (not iceberg), bell pepper, cucumber and a little coriander. These provide a good mix of nutrients while not introducing too much calcium.
This is the recommended diet.
Water and pellets introduce more calcium than veg does. So filtering and keeping pellets limited (as well as checking the type of pellets you are feeding/ their ingredients) can help. However there is a balance to be struck. Cutting calcium down too low can be just as bad as a diet which is too high. By not feeding pellets (or not feeding often) you then have more leeway in other areas of the diet.
You should not make them gain weight by giving extra or sugary veg and fruit.
Giving sugary food or too much veg will cause dysbiosis and yellow fat formation (from sugary foods). That means that as well as risking upset tummies, as soon as you stop giving sugary food, all the weight will fall off of them again.
It’s like a human choosing to eat chocolate bars to gain weight, it’ll work, you would gain weight but it would be unhealthy weight gain which risks other health issues. You then lose the weight again when you go back to a lower calorie/lower sugar intake diet.
How were they diagnosed as being underweight?
If it was just by the number on the scales then that is not the right way to do it as there is a huge range of healthy weights for piggies.
You have to check their heft, by putting your hands around their ribs (weight management guide below).
If you do need weight gain in some of them then try giving a few top up feeds of critical care for the additional fibre and calories. You can also give a small amount of plain oats each day.
Pellets should only be one tablespoon per pig per day. They do contain more calcium than the highest calcium veg so making sure you feed only the recommended amount or less will help.
As pellets only make 5% of the diet and hay is 75-80% then cutting pellets down (even if not out completely) shouldn’t make a huge difference to causing weight loss (it may make some) but their hay intake should increase as a result which then has good health implications all round.
I don’t feed mine pellets at all and there was never any weight loss from being fed them to not being fed them as they just increased their hay intake.
(I actually went from feeding pellets daily, to only feeding them twice a week, to not feeding them at all)
Weight and Weight Loss Explained: BMI, Weighing, Poos and Feeding Support
Long Term Balanced General And Special Needs Guinea Pig Diets