Backside pain like you describe can be very difficult to diagnose. Twenty years ago i had the pain that you describe. For many months it was treated as hip pain, but was finally diagnosed as a ruptured disc in my back. The back surgery completely eliminated the pain immediately. For the last ten years, I have been dealing with similar pain on the opposite side, and this time went with the hip diagnosis (x-rays and MRI show problems in both areas). After a resurfacing in June, the pain is gone, except for in the late night and early morning hours when it still wakes me up, though this continues to improve some.
My only advice is to really try to get a clear answer on the primary cause before going for surgery, since the referred pain can be so similar.
John