Spoilers. Dont read if you didnt watch movie
So Efrons character was stupid enough to be tricked into staying. When it was obvious that shady guy would just let him die from dehydration and then return and have all gold to himself. Because it was obvious solution about sharing gold.
They should have bury it and go together. No one would find it. After all it was hidden for centuries...
It was very lazy script. And then we have to sit for another hour, watch Efron slowly dying to have them Throwing Shocking Twist at as. The one we knew about the moment second guy left.