Andre Wisdom crossed the ball in, trying to set up an opportunity for Derby, but he had no teammates in the box to tap it in.
The Rams made a bright start to the second half as Craig Bryson unleashed a powerful strike from 20 yards out, but Dimitrios Konstantopoulos was able to make the save, while Bamford headed over from close range a couple of minutes later.
The home side almost took the lead against the run of play as Albert Adomah caught Derby out with a counter-attack, but his effort finished wide. Chalobah managed to find the target five minutes later, drilling the ball in low to break the deadlock.
Bryson came close to adding a late equaliser for Derby from a free kick, but it was deflected behind by the hosts, ensuring that they held on for the win.
The result leaves Middlesbrough 13th in the Championship table, while Derby sit fourth.