Mountain bike tyres unreliably lose and keep pressure?
Sounds like the butyl rubber inner tubes have perished a little, and you have either a very slow leak, or a valve that lets the air out slowly.
Just buy three new tubes from an online supplier - they'll cost about $5 each.  Two to fit, and one to carry as the spare.  You should also have two/three plastic tyre levers, a working pump, and whatever tools are needed to get a wheel off the bike.
The old tubes can be used to hold plants to stakes in the garden, or as a chainstay protector, or sliced up into rubber bands.
Also, I'd suggest having a close look at the tyre's surface, and decide if they're getting a bit old.  Rubber is attacked by ozone, UV, and heat, so if your bike was stored in a shed/garage then they can slowly deteriorate.  If you're doing strictly road riding then its a good chance to change to more efficient tyres too, compared to MTB knobblies.
Finally, check your brake pads.  Rim brakes have rubber blocks which can harden with age, so your brake performance can suffer.  Disk brake pads are not rubber so don't deteriorate in the same way.
These are all consumable items, so don't get put off by some costs.