Should I apply again to the same research group where I used to work and haven't got any PhD offer from the professor?
You got scooped. That sucks, but it happens a lot; and it is definitely not the end of the world.

If you think your work was good in the group, I would say go ahead and apply. You could explain to him why the project was delayed; a polite discussion cannot possibly hurt you, and you can figure out in which terms they are with you. Remember that even if you were in your best conditions, some other group may have just more people working on the same problem, or they started one year before you, or any other reason.

By the way, you have now a working implementation of the analysis, and perhaps you can improve it to do something the other group didn't; implement other algorithms, etc.