If two consequtive stages have the same lock acuired, is it always released upon stage complete or in that case it is transferred and other build could take it ?
Yes, locks on shared resources at the stage level are always released on stage completion.
Locks on shared resources at the configuration level are released at build completion, unless they are transferred to a new build by a Build Completed trigger with the “Transfer any shared resource locks acquired by the triggering build” option checked.
Stage level locks do not get transferred by build completed triggers.