#Java 8, 54 50 bytes
Java 8, 54 50 bytes
(h,m,H,M)->Math.min((H-h+24)%24+(M-m+60)%60,H+M+2) Port of @KamilDrakari's C# answer (after I golfed 2 6 bytes).
Explanation:
(h,m,H,M)-> // Method with four integer parameter and integer return-type Math.min( // Return the lowest of the following two: // The hours: (H-h // Second hours - first hours inputs +24) // +24 so we won't have negative numbers %24 // mod-24 to get the hours + // And add the minutes: (M-m // Second minutes - first minutes inputs +60) // +60 so we won't have negative numbers %60 // mod-60 to get the minutes ,H+M // And compare it to the second hours + second minutes inputs +2) // +2 for the added +24 and +60 to get the positive modulo arguments