Reverse-engineering recurrent neural network solutions to a hierarchical inference task for mice