Theory of photoinduced ultrafast switching to a spin-orbital ordered hidden phase