The Chizkuni on this pasuk explains that during a war, it is common practice for a leader to just "watch" the other men fight, while being positioned on a hill or mountain, to encourage the fighting men and not actually joining the fight if you are a "high placed official or leader". In our times, when there is a war, this is exactly what happens. The "leaders" will literally lead the people at battlefront, while watching "from behind":
אנכי נצב על ראש הגבעה, “I will position myself on the summit of the hill;” Moses wanted to be able to follow the course of the battle while personally watching, and even more, so that the Israelite fighters could see their leader and be encouraged by this visual contact. We find a verse in Joshua 8,26, where the latter, by that time the leader of the Jewish people, emulated Moses’ example by not lowering his spear until victory in battle had been secured. It is a common practice in war that one of the popular heroes positions himself on a hill or tower, holding aloft a flag in order to serve as encouragement to the troops seeing that the flag is a common symbol. As long as the troops can see their flag being held aloft they derive encouragement from this. If for some reason the troops fail to see the flag being held aloft they become demoralised. Moses’ staff in this instance served as a flag for the Israelites fighting Amalek.
From this it would seem that Moshe Rabbeinu wanted to encourage the men fighting, while being posisitoned on top of a hill, so that everyone could see him.
Moses’ staff in this instance served as a flag for the Israelites fighting Amalek.
The Chizkuni sees it this way, but the Ramban on the other hand, says something else:
The reason that Moses commanded Joshua to fight with Amalek was so that he [Moses] might pray with the raising of hands on the top of the hill.
Instead of "encouraging the fighting men", Moshe Rabbeinu ascended the hill/mountain in order to bless them:
He went up there so that he might see the Israelites engage in battle and train his sight on them to bring them blessing. They too, upon seeing him with his hands spread heavenward and saying many prayers, would have trust in him, and they would thus be endowed with additional valor and strength.
In a similair vein to what the Ramban writes, the Malbim on this pasuk explains:
Moshe said to Yehoshua. Moshe’s special abilities lay in the realm of the supernatural. For this reason he conducted the wars against Sichon and Og personally, since those wars were openly miraculous. On this occasion, by contrast, Hashem hid His face so that they were required to do battle in a natural manner. Therefore Moshe delegated command to Yehoshua, who had been chosen by Hashem to lead the conquest of Canaan, which was to be accomplished through natural wars accompanied by hidden miracles. Nevertheless, Moshe helped in the battle against Amaleik through prayer and urgings to repentance in order that they would enjoy Divine favor. With the staff of Hashem. The staff was called by this name, rather than “Moshe’s staff,” whenever Hashem performed through it a miracle for which the B’nei Yisrael were not worthy, solely to display His power.