Samurai VS Conquistadors
Samurai VS British Red Coats
Samurai VS Aztec Warriors
Samurai VS Spartans
So, I think that you are more or less comparing equipment and tactics, as numbers, quality of soldiers and commanders would all be equal to both sides, unless specifically said so to compare a particular scenario.
Samurai Army from late Sengoku Jidai vs Western European Army from 16th century. The Samurai Army has gunpowder weapons, yari spears as long as pikes and naginatas, their characteristic armor, mounted samurais and bows, the Europeans have pikes and halberds, gunpowder weapons, plate armor, bucklers, and knights. The Western European Army Wins, Europe has overwhelming superiority in armor and cavalry which give them tactical superiority.
Samurai VS Aztec Warriors - Samurai from any period wins, as they have at least Iron and Horses.
Samurai from 12th century VS Greek Phalanx Army - The samurai can beat them if they use their superiority in cavalry and archers to attack the flanks and rear of the greeks. If the greeks are from a late period it will be harder as they started to use more auxiliary troops. If the opponents were not greeks but Macedonians from Philip or Alexander I would say that the Samurai Army has a slightly advantage of being 15 centuries in the future.
Samurai from 12th century vs Roman Army of 2nd century - Rome wins easily, they have a better combination of shields and armor, auxiliaries to make up for their deficiencies in cavalry and light troops, they have tactical maleability and superb system of communication.
Samurai from 12th century vs Western European Army of 12th century (Probably France) - Western European Army has a slight advantage because of their better armor and shield combination, and better cavalry, the europeans have more options of weapons to use too.
If you start putting variables in terrain, numbers, awareness, information, and command, the situation can go to any direction that you want, I am considering that:
The battlefield is a plain wide grassland without rivers.
The weather is dry.
Both sides are of equal size, can prepare themselves for battle as they want and know the enemy composition, but can't change the terrain or make fortifications.
The commanders are both competent and at the same level.
Neither side is in friendly territory.