These tunnels were built in the early 1900s to avoid going around 300 foot deep canyon. Instead, engineer Andrew McCullough (& his helpers) went right through it. It was the most expensive mile of the Railroad.
Really, if you're on Highway 5 near Hope there's no good excuse to not stop, after all Rambo: First Blood was filmed there. And it's right off the Highway. And it's really cool.