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.
Will Rhymes had three hits and scored twice for the Nationals, and Mike Fontenot drove in three runs.
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.
"If it's close, we have to practice coordination of (the system) and all that stuff," Williams explained. "We didn't know whether we'd get a chance to even get to one in the game, so we were going to go out on the first close one and practice."
Roark had some misgivings about the system.
"I'm skeptical about it. I think it's going to slow down the momentum greatly, of a pitcher, of a ballclub," said Roark, who was out of the game before the challenges occurred. "We'll see how it goes. I mean, I want the calls to be right, but it's just baseball. You can't get everything correct. Everybody makes mistakes."
Astros manager Bo Porter successfully challenged a call in the seventh, giving Delino DeShields an infield single.
Nationals: Roark, who started five of the 14 games he appeared in as a rookie, is bidding for the No. 5 spot in the rotation. "I want to make the team very badly, and however I can help out the team, I will," he said.
Astros: The 32-year-old Jerome Williams, who started 25 games for the Angels last season, doesn't know whether he will get another start. "I'm just playing it by ear," he said. "Whenever they tell me I'm pitching, I'm pitching."
Ian Desmond was a late scratch from the Washington lineup after a pregame grounder cut the pinky finger of his right hand. He might miss a game or two, Matt Williams said. Jamey Carroll replaced him at shortstop.