Bayformers prime wins if it is him, he's a killing machine. Also what would aid is if prime were to think iron giant was a threat he would run in and surprise attack IG and probably kill him if he could. Not only this but iron giant would hesitate to attack, especially against something so different yet so similar to him. He is more like optimus prime than the bayformers optimus prime, and that's why prime wins. If it were any other prime I would still say he wins cause he has had a lot longer of an existence and has a lot more lore, that being said g1 prime would lose. But most other primes would win especially if it were bayformers or aligned prime.
I think people are forgetting about the spirit of vengeance, that would make GR curb stomp Thor. DS said that, during world war hulk, the spirit of vengeance would be able to stop world breaker hulk, the strongest version of the hulk, but because hulks doing nothing wrong ghost rider wouldn’t beat or fight him. He also states ghost riders power is limitless and god like. Not only this but GR, when spirit of vengeance wasn’t in control, was able to stand his ground against hulk something only the sentry could do.