Mariano Moreno, Gobernador Castro