This depends on the country in question, but generally, the first born would be the heir apparent.
I don't think it ever actually happened that two twins survived long enough (i.e. to when their reigning parent died) for this to ever become an issue. That being said, James II of Scotland (not England) was the younger twin (i.e. second born) of his father, James I. The elder twin, Alexander, Duke of Rothesay, died in infancy. I should note that at this time, (1430s), the title Duke of Rothesay was already being used to denote the heir to the Scottish throne. As it would turn out, James II would succeed to the throne at the ripe old age of 7, owing to the murder of his father James I.
Another interesting case would be the seat of the Counts of Barcelona in 1076. Berenguer Ramon II ruled jointly with his twin brother Ramon Berenuer I, from the death of their father (1076) until they decided on separating the realms between them. Some time later (1082), to be exact), the former - allegedly - killed the latter. Berenguer Ramon II was then given the name "the Fratricide".