Is the hashrate the same for Rx 580 and RX 480 mining Lyra2z?
Only if you've got them at the same power limit, voltage, and clock. the 480s reference power limit and clock speed are lower than the 580s, so in general no it's not the same.
RX 480 clocks to 1266mhz by default, 580 to 1340. RX 480 default TDP is 150W and 580 is 185W TDP, and I believe amdgpu doesn't allow raising the powerlimit that the powerplay table should allow so you aren't going to raise a 480 to match a 580 on core-heavy algos like lyra2z.
Personally, because of that I modded my vbios on an RX 470 to adjust the TDP to be raised by around half of the powerplay powerlimit range, and then lowered the powerlimit range so I wouldn't accidentally exceed the card's actual limit by much when I got to an OS that allows adjusting it. (89W to 100W TDP, 20% Powerlimit range down to 8%.) I couldn't get over about 2.8MH/s on it before and now I'm getting 3.1, and I'm sure with more fiddling I could get further.