The 4.0 ohv is a bored and stroked 2.9.
Chances are the trans will work, you may need to tear it down to swap the tails shafts/housings.
Unfortunately the bronco might be toyo kogo and the ranger has a Mazda trans. So you would need to source parts for the swap.
Do some reading over at trs.
The Ranger Station - Technical Library