Make a "T" shape with the two bars such that the end of one touches the middle of the other.
Since the middle of the magnet is neutral, touching the end of the iron bar to the middle of the magnet will not produce any force of attraction.
But touching the end of the magnet to the middle of the iron bar will produce a force of attraction.
So when you make a T shape, whether or not the bars are attracted to each other will tell you which is which.
There are other solutions in the comments, but I can't vouch for their validity =)