Nearly Optimal Latent State Decoding in Block MDPs