I would put the 4 yo on top but express how careful he needs to be. Like no horseplay on the top bunk, and don't get too close to the edge. And just tell him "only big boys get to sleep on the top bunk so you have to be a big boy and listen to what we tell you" just maybe to help. I think it'll be fine.
Idts. My nephew has a bunk bed and he's 4. I would just put the 4 year old on top and 2 year old on bottom.