一(yí)样(yàng) and 相(xiāng)同(tóng) both means ‘same’ in English and they are interchangeable in many occasion.
But 一样 can modify adjectives while 相同 can not. For example,
1) 她(tā)和(hé)你(nǐ)一(yí)样(yàng)漂(piào)亮(liang)。
She is as beautiful as you.
2)*她(tā)和(hé)你(nǐ)相(xiāng)同(tóng)漂(piào)亮(liang)。
In addition, in terms of pragmatics, 相(xiāng)同(tóng) is more frequently used in written Chinese.