The Jambos had Gary Webster sent off for a second bookable offence with just 28 minutes on the clock, while the home side were also reduced to 10-men a minute before the end when Nicky Riley was red carded.
Ryan Conroy scored the only goal of the game 10 minutes from time with a deflected 30-yard free-kick but Locke felt his players had done him proud.
"I thought we were pretty well organised even when we went down to ten men so early in the game," he told Hearts' official website.
"We were quite comfortable. I didn't feel like they created an awful lot, it was always going to take a goal like they scored to win the game.
"I was delighted (with the way we reacted). We went to two banks of four with John Sutton up front. We got Dale Carrick in at half time and tried to get a bit closer to Sutton.
"It was always going to be a difficult game today with so much at stake but it certainly would've been easier with eleven men on the pitch."
Locke felt Webster was unlucky to be sent off for an aerial challenge on John Baird after he had received his first yellow card for bringing down Carl Finnigan.
"He was going for the ball. If he was leading with his arm, fair enough, but he is genuinely going for the ball," he added.
"The two boys clash heads and we end up with 10 men. To say I'm not happy is an understatement."
Locke told the club website he is now keen to return to winning ways against St Mirren next week.
"After a disappointing result today we need to try and get back on track ourselves," he said.
"It's been disappointing today but we've got next week to try and lift the players and hopefully we can get three points at home to St Mirren."