السلام عليكم ورحمة الله وبركاته احسن الله إليكم Me and ~40 people go sometimes hiking and on these hiking trails most of it is just one pathway and around is tree and obstacles. When its time for prayer, sometimes where there is nowhere to pray except on the pathway due to no space. Is this okay?

Ustadh AbdulAziz al-Haqqan
The prayer is valid. What is avoided is praying in the middle of a path where people pass or where there is harm. So, if there is no other place and you do not block the way or expose yourselves to harm, there is no problem, and praying to the side where there is room is better.