Having passed up two break points of his own, Federer was punished when Brands broke at 4-3 before serving out the first set to take the advantage.
However the world number five, who was debuting a new, larger racket, rattled off the next two sets with ease.
Such was the Swiss’ dominance, he only lost two of 22 service points in the second set and, despite missing two match points at 5-2 in the third, he wrapped up the win in one hour and 25 minutes to progress to the next round with his next match point.
Joining the 17-time Grand Slam winner in round three is second-seed Tommy Haas, who also needed three sets to progress having beaten qualifier Blaz Kavcic 6-1 4-6 6-4.
Fifth seed Juan Monaco, meanwhile, saw off Gael Monfils with two well-timed breaks of serve in as many sets.
ATP Hamburg round two results
1-Roger Federer (Switzerland) beat Daniel Brands (Germany) 3-6 6-3 6-2
2-Tommy Haas (Germany) beat Blaz Kavcic (Slovenia) 6-1 4-6 6-4
4-Jerzy Janowicz (Poland) beat Robin Haase (Netherlands) 6-4 3-6 7-6(4)
5-Juan Monaco (Argentina) beat Gael Monfils (France) 6-4 6-4
Federico Delbonis (Argentina) beat 10-Tommy Robredo (Spain) 6-1 4-6 6-4
11-Feliciano Lopez (Spain) beat Jan-Lennard Struff (Germany) 7-5 6-3
Guillermo Garcia-Lopez (Spain) beat 13-Mikhail Youzhny (Russia) 6-3 6-7(3) 6-2
14-Fernando Verdasco (Spain) beat Roberto Bautista (Spain) 6-4 3-6 6-2
Jan Hajek (Czech Republic) beat 15-Ernests Gulbis (Latvia) 6-4 2-6 6-4
Carlos Berlocq (Argentina) beat 16-Martin Klizan (Slovakia) 4-6 6-1 7-6(6)