[Kernel] Fix bug in Einsum implementation when a lone operand had a reduction operation (#27225)
### Description
When the lone operand had a reduction operation in Einsum, there was a
mis-management in the shape which led to a mis-match in terms of the
subscript indices in the output as deciphered from the Einsum equation
and the rank of the candidate output being produced after the reduction
operation which caused issues while finalizing the output of the Einsum
op.
This change fixes the bug and adds a test
### Motivation and Context
Resolve https://github.com/microsoft/onnxruntime/issues/18654
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>