Trans is bad
Good news it is an M50D-R1, '88 was the first year they were used in Rangers and they were used until 2012, so you won't have a problem finding a used one.
2.9l uses the same trans bolt pattern as 4.0l OHV(or SOHC).
You can rebuild it but contrary to what you may be feeling now the M50D-R1 was a super reliable transmission, so used isn't much of a gamble if trans fluid smells OK.
You may be able to move it in 4th gear, as that is a direct path thru trans, but really depends on what broke inside.
The whine was from a gear being chewed up, input shaft gear is my guess, probably from low trans fluid.
If you have never rebuilt a manual trans M50D-R1 is a good one to do, but really up to you.
Used trans will, in most cases, be cheaper than rebuilding it yourself