All right. I’m going to assume that Iron Man is in the Mk 13 version of the Hulkbuster (the main one used in the comics) without much of the heavy things on it designed for being used purely against Hulk (such as things to drain Gamma Radiation).
Amog the weapons of the Hulkbuster suit are not only the physical capability to exchange (and take) punches from the Hulk, but weapons designed to disorient and otherwise try and disable him – such as heavy sonic disruptors, upgraded repulsor rays, etc.
Also for the purposes of this fight will be assuming that Tony will not be displaying some of hsi abilities to hack via technopathy/cyberpathy as he has displayed at some points via Extremis abilities or Jarvis as quantifying how effective said abilities are against other purely technological beings (such as the Phalanx) is outside my knowledge of Iron Man.
Stats for G1 based Optimus Prime (outside of comic showings) will be used priarily from the G1 comic Transformers Universe, the main bio for many of the characters written by Bud Budianski.
Optimus’ strength is listed in his ‘Abilities’ as being able to punch with 40,000 pounds per square inch of force, or about 2000 tons of force. Given that Tony’s armor can take multiple blows from Hulk, who is regularly shown as having strength feats in the hundredsof thousands to millions of tons range, this is not particularly impressive. However, Tony’s armor does not hold up particularly well to Hulk, and often a few hits prove disabling or crippling to it, and Hulk is not a particularly intelligent fighter and Tony’s armor is designed specifically around countering and weaekning him. However, it does not seem like fisticuffs will be particularly effective for Prime on Iron Man – Tony can take hits from a far more powerful foe.
The normal Iron Man armor can cruise at least at Mach 10, though unless Tony goes out of the Hulkbuster suit he does not have this degree of mobility. Tony seems to be limited to usig his repulsors for short ‘leaps’ or jumps in flight or moving at a few hundred miels per hour. Optimus as a semi truck is capable of driving at 200 mph casually and capable fo hitting greater speeds for short times. Even in Hulkbuster, Tony is more mobile. Optimus’ primary ranged weapon is his Ion Rifle, which is said to be able to ‘hit a dime at a range of 20 miles’. Optimus’ is a crack shot with it, able to hit enemies who often strafe at supersonic speeds from miles away (your nominal Decepticon Seeker/Skyraider, or jet). The damage of the weapon varies, but seems to be nominally less than Tony’s standard Unibeam at it’s higher ranges under normal circumstances. It is an adaptable battelfield rifle, capable of long range sniper shots, automatic fire and short range high intensity blasts that at times have staggered even Devastator. However, Tony’s Hulkbuster suit has a far higher ability to crank out energy blasts by the nuermous arc reactors fueling ti which allow him to do the equivalent of multiple Unibeam level blasts. Optimus has his combat deck and Roller, but Roller is a scout vehicle, and the Combat Deck is otherwise an immobile artillery platform – both would be easy to destroy/disable at the start of the fight so they are unlikely to be any advantage. Given the fact they often heavil disroient Optimus when either takes damage, he is unlikely to deploy them.
For durability – the normal Hulkbuster suit can take several direct hits from an enraged Hulk before battle damage renders it mostly unusable, longer if Tony is able to put extra parts into it via it’s modularity (not always displayed in comics, but a part of his strategy in Age of Ultron to slow down Hulk). Optimus Prime has survived uncontrolled orbital reentry after a direct hit from a capital ship grade laser (More than Meets the Eye pt 3) after a pitched battle with the Decepticons, hits from Megatron’s fusion cannon which can fuel itself with antimatter to have a blast capable of destroying cities (Megatron’s Transformers Universe Bio) which Prime can shrug off fairly consistently. Prime has survived being grabbed in Omega Supreme’s claws, in some Transformers continuities facing Unicron’s literal maw and the reality remaking blasts within that can devour planets and in virtually every continuity hand to hand ombat with Grimlock, who has a weapon and teeth that are sharp and powerful enough to rend atoms apart. Prime has shrugged off point blank hits from Galvatron in cannon mode, who at his peak displays of power has destroyed a planet large/dense enough to have Earth normal gravity (Five Faces of Darkness Pt 2 I believe). While admittedly this draws from a variety of continuities to offer examples, and in general the Transformers mythos treats each individual continuity as it’s own thing.. Optimus has much greater durability showings than Stark does. Hulkbuster is deisgned for one thing – taking blunt hits. Optimus takes antimatter blasts, brutal slugfests, monofilmanet energy blades heated to several thousand degrees kelvin, and the fires of the Chaos Maker and survives.
Tactics and strategy – Tony is an extremely talented combatant with a flair for improvising tactics on the fly who enjoys fighting and is adept at improvising. He tends to confront problems head on, and while perhaps the smartest engineer on the planet, he tends not to plan significantly for battle, trusting his armor’s modularity and his propensity to improvise and strategize most of the time. In most teams of the Avengers he is quite happy to let a more gifted tactician take charge in the field and while Chairman will often be more of a charismatic leader than a field leader, yielding to Captain AMerica or others quite readily, though when push comes to shove Tony shows a flair for making up effective plans on the spot and adapting to his enemies. He has lead the Avengers on multiple occasions, multiple iterinations of Stark Enterprises/his personal company, and at times been shown capable of strategic thought to hold his own in outplanning beings like Doctor Doom and Kang the Conqueror. HOwever, his tactical abilities are second to folks like Captain America or Reed Richards.
This is where Optimus shines the most, honestly. Optimus has lead the AUtobots in galaxy wide conflicts, planetary campaigns, city defense, on the squadron level.. Prime has lead the AUtobot war effort in name, face, and at every level – operational, strategic, tactical. Whether it is fighting off a seige of Iacon, disrupting Decepticon infiltration units sent to Earth, forging an alliance to drive off Unicron.. Or just responding to a Decepticon energy raid. Prime is an immensely gifted tactician whom in virtually every continuity has been in constant war for millions of years, and is willing to get his servos dirty, and iwll not have his Autobots do anything he would not himself. Capable of coming up wtih grand strategic battleplans, adapting o the fly, he also has the skill to outmaneuver extremely gifted adversaries like Dark Gods of Chaos, MEgatron, and even turn Starscream’s ienvitable treachery to his battlefield advantage.
The advantage Tony has is his ability to try and calculate opponents technological weaknesses on the fly and come up with ways to counteract them, which I don’t think will not be a major factor in this fight given that Tony is in the Hulkbuster suit, which does not lend itself to the technological modularity or adaptability that he often displays to do against such enemies.
Tony has a mobility advantage over Optimus via his repulsors, limited flight, and Optimus being groundbound and otherwise limited to running or driving speeds. But, the Hulkbuster does not have the maneuverability to really make effective use of this advantage – this fight will be up close and servo to servo. Weapons like his sonic disruptors or other things deisgned to disorient Hulk will probably be of minimal effectiveness against Optimus so I don’t think they would be a major factor in the battle.
Tony’s advantages are (limited) mobility, greater strength, and greater firepower (The multiple Unibeam level blasters in the Hulkbuster trump Optimus’ Ion Rifle), as well as sgifniciantly superior ability to take blunt damage (He can take several hits from Hulk, Optimus is nowhere near that strong). Optimus major advantage are in sheer experience (millions of years of combat leadership), tactics (He is Optimus Mothertrucking Prime), and insnae durability.
Ultimately barring Tony finding some way to recognize a technological wekaness in Optimus’ form and hitting on it (which even after millions of years Megatron hasn’t) or a way to overwhelm Optimus with the Hulkbuster’s superior firepower, I think Optimus wins by virtue of being able to take what Tony can dish out, reognize the weaknesses inherent in the Hulkbuster (bulky, strong, but designed solely to take blunt damage) and slowly whittle away ti by attrition while using his superior marksman (or marksmech)-ship to blast the suit apart or disable the power units which are always a weak point to take out the suit by hit and run tactics.
Now, whether the fight ends when the Hulkbuster suit is rendered non-operational and if Prime then has to fight whatever base suit that Tony has on underneath it (as Tony has been shown to eject from the Hulkbuster when damaged to fight on), which is likely to be much more effective against Optimus due to the heavier mobility it has and modularity it entails, or can call in other, heavier suits to back him up (such as the Extremis) is the call of the OP. But, if the fight is to the Hulkbuster suit being rendered non-operational for continued combat, heavy odds to Optimus to win.
(Note: Sorry for lack of scans and links, and also note in my argument for Optimus I am drawing from a numbmer of continuities rather than just one in specific, which some people consider inappropriate in these sorts of ‘discussions’ rather than limiting to just one canon)