Can just swap out to disk and resume job later. If job provides rollback points, can roll job back to point before acquired resources. At a later time, restart job from rollback point. Default rollback point - start of job. For some resources must just kill job.
All resources are then free.
Can either kill processes one by one until your system is no longer deadlocked. Or, just go ahead and kill all deadlocked processes. In a real system, typically use different deadlock strategies for different situations based on resource characteristics. This whole topic has a sort of 60's and 70's batch mainframe feel to it.