This type of thing is super hard to diagnose over the internet because "feel" is so subjective, but I'll do my best...
First test, If you are coasting along and press the brakes down to a certain point so you start slowing down, but not too quickly, and hold them (dont press further or let up) does it feel like the truck keeps slowing down at the same rate, or does it kinda slow less and less? If it kinda slows less and less, that probably the master cylinder.
Second test. Get going and then lightly press the brakes, the press a little more, then a little more, then a little more, etc. Each time you press a little more, you should start slowing down at a slightly higher rate. If you can go quite a ways ("quite a ways being highly subjective") with no change in how quickly you are slowing down, this is whats typically describes as "spongy" brakes, and is probably caused by air in the system, but could also be a brake hose going bad.
As for how the air got in there, it doesn't necessarily have to have come from the outside as air. Brake fluid absorbs water easily. In a sealed system it shouldn't be an issue, but every time you open the reservoir to add fluid, you are exposing it to the air, and over years of this if you dont bleed the brakes often enough, you can get enough water in the system to boil when the brakes heat up, which creates air bubbles....
I would start by bleeding the brakes. Get a big bottle of brake fluid and fill the reservoir all the way, start at the right rear tire and bleed till you see fresh clear fluid, the do the same on the left rear, right front, then left front. Keep on eye on the reservoir, if you let it get too low it will stuck in air, then you have a even bigger problem....