How to compare the length of ciphertext

I have two ciphertexts, how can I determine whether the lengths of the two ciphertexts are equal without decrypting them

If by length of the ciphertext you mean how many non-zero elements are encrypted, you cannot do that without decrypting anything. If you could, an adversary could distinguish between ciphertext, and the scheme wouldn’t be IND-CPA. You could maybe compare both ciphertexts to zero element-wise, further process the difference and decrypt it.

If you mean the length of the ciphertext the batch_size, this can be obtained from the ciphertext metadata, by calling GetSlots().