Apple is still signing iOS 6.1.3 for the iPad 2, so if you can find a copy of the ipsw, it might work for the iPhone 4 too. (Source: I saw something about it on Reddit in a thread about jailbreaking and then tried it because iOS 11 or 10 on iPad 2 is incredibly slow. It worked.)