Based on your post, here’s how I see the relations:
Team → Sprint → Release → Task
Release ↔ Team → User ↔ Task
So if a User from Team A is linked to a Task, you want the Release to link to Team A’s current Sprint, right? But what if a User from Team B is now linked to the Task?
According to your relations, only one Sprint can be linked to a Release, so should it be Team A’s current Sprint, or Team B’s?