If the hydraulic hoses weren’t cut, exposing pump/motor internals to the elements, you could possibly just replace shaft seals and call it good. That should be a relatively quick and inexpensive rebuild.
Total rebuilds of pumps and motors are basically bust apart, clean, new gaskets’n’seals, reassemble. They’re built in layers. Before disassembly, mark the layers so that you stack them exactly the same way they came from the factory. In the Army we punched them leaving dimple marks in the steel.
one dot top of first plate, two dots bottom of first plate.
two dots top of second plate, three dots bottom of second plate.