To unlock the Dark and Hero gardens in Sonic Adventure 2 Battle, you evolve a child Chao into either a Dark or Hero Chao.
The type of Chao you get depends on which character pets it, and it does not matter which specific hero or dark character you choose.
For the Hero Garden, pet the Chao with a hero character. It should turn mostly white with blue on the hands and feet and a yellow stomach. Wait for it to evolve into a Hero Chao, and the Hero Garden is unlocked.
For the Dark Garden, pet the Chao with a dark character instead. It should turn black with red on the hands and feet. Once it evolves into a Dark Chao, the Dark Garden is unlocked.