A £5 million investment will see specialist frontline staff sent to 80 jails in a bid to ease the current capacity crisis.