Rear brake problem on steep incline/decline

Over the weekend i found several times that my rear brakes would fade to nothing at all on steep incline /decline. The lever would go right to the bars but after a pump or 2 it would be back to normal but on any sort of flat ground they would work as they should. The master cylinder is full, havnt had an time to look further into it but i figured i would ask if anyone experienced the same problem.