This post outlines the problem pretty well as wall as part of the solution:
However our build server did not read the mecurial.ini file when placed in the SysWOW64/config/systemprofile folder.
(You can test this by running hg showconfig from the console running under the systems account.)
Instead we had to place it in the TortoiseHG installation folder.
We also tweaked it a bit according to the BitBucket documentation on SSH.
[ui] ssh = "TortoisePlink.exe" -ssh -2 -batch -C -i "c:\path\to\key.ppk"