If you select Apple's Upgrade option your device will become unjailbroken.
Why: Apple's Upgrade process replaces all software on the primary partition and leaves only your data. All jailbroken programs are deleted.
The tools for jailbeaking iPhoneOS 3.1.2 may also work to jailbreak 3.1.3.
This does not work on the most recent devices, such as the iPhone 3G[S] or any of the modern iPod Touches (whether 3rd Generation or recently manufactured 2nd Generation).
Upgrading the iPhoneOS firmware of your device using iTunes upgrades your baseband, which in turn will disable your unlock and prevent modern tools from re-unlocking it.
In specific, the 3.1.3 baseband is not able to be unlocked using blackra1n.
Users of unlocked iPhone 3G's or iPhone 3G[S]'s should not upgrade until a new unlock tool is released.