Castro connected off Nationals starter Tanner Roark for his second home run of spring training.
Roark, bidding for the fifth spot in the Nationals' rotation, gave up three hits and three runs over 3 1-3 innings of his second start.
Houston starter Jerome Williams gave up six hits and four unearned runs in 3 2-3 innings.
In their first game using instant replay, the Nationals came out on the losing end of two challenges.
Manager Matt Williams challenged an out call at first base that was upheld in the sixth and Astros manager Bo Porter successfully challenged a call in the seventh, giving Delino DeShields an infield single.