AFAIK, currently, all local variables in a function get allocated to separate memory locations (regardless of block scope), Making your first example the more efficient use of memory, at the potential cost of subtle bugs to due to the reuse of the value. But this is a non-guaranteed happenstance of the current implementation.
You cannot depend on this behavior. No decision has been made and Zig does not yet have a specification. In the future, it may be decided to optimize stack frame layout and reuse locations that are out of scope. If that happens, then there would likely be no difference in the size of the two stack frames.
It’s worth noting that zig could leave this up to the optimiser, and zigs calculation of stack size doesn’t need to match what the optimiser achieves. It’s ok for zig to think the stack is a little larger than it needs to be.