Castro's first homer -- a two-run shot -- came in the third inning and staked the Astros to a 5-0 lead. He added a bases-empty blast in the seventh and finished with three runs scored.
Brandon Barnes supplied a two-run double while Robbie Grossman and L.J. Hoes each drove in a run for Houston, which clinched its three-game series.
Brad Peacock (3-4) earned the decision despite allowing four runs on six hits over 5 2/3 innings. He walked two and struck out five.
Chia-Jen Lo hurled a scoreless ninth for his second career save.
Toronto's Chien-Ming Wang (1-2) was tagged with the loss, allowing five runs (four earned) over three innings.
Kevin Pillar smashed a three-run homer and Edwin Encarnacion added a solo shot, his 33rd home run of the season, for the Blue Jays.
18-year-old elf alleges mall Santa pinched her buttocks on the job
Caroline Berg Eriksen: Soccer player's wife triggers debate with post-birth selfie