Segmenting encryption to get the same results with the same key
Yes this would work as stated by you.

Explanation:

If you're using a library supporting ECB (which you are actually using in this example) you can input the whole 32 bytes of plaintext and will receive the corresponding 32 bytes of ciphertext. Splitting the operation into two calls doesn't make any difference for libraries as internally they do nothing else than simply calling the encryption function for each block and concatenating the ciphertext to get the output.

Standard note:

Do not use the encryption mode proposed by you (ECB) in the "real world".  Rather use GCM or an other authenticated encryption mode as you also have to check if your data was altered and came from the correct source.