As many have said here, returning it is a bad idea. I've spoken to many marine biologists specifically on this topic (general marine life) and the main concern is bacteria, viruses, etc that may not be infecting the animal but on them. Our tanks are a mix of life from all over the world, so would be horrible to release any of that microscopic life.
Park rangers are not marine biologists normally. They are used to stopping people with them in their car while leaving the park. Something held in a reef tank is not something they would be experts on and I would not trust their judgement.
My personal recommendation is to contact a local aquarium or natural science museum. I used to assist at a natural science museum that did house many horseshoe crabs. They had them of all different sizes. If it were safe to release one, they would know and would work with local authorities to do so. If it was not safe, it could then live in one of their large tanks with experts taking care of it. And since they would often get horseshoe crabs on purpose, this would be saving another from being caught just for them.
Lastly, one thing I remember the marine biologist specifically mentioning was that baby horseshoe crabs had a very low survival rate.