Why is this ANN not working?
You're using the SGD optimizer, but you're only making one pass over the training data.  I think the default learning rate for SGD is something like 0.01 or 0.001, and, with such a low learning rate, your model won't be able to learn the pattern with a single pass over the data.

To fix this, you need to do one or both of the following: 


raise the learning rate 
train the model for more epochs (an epoch is one pass over the training data)


To raise the learning rate, you'll need to create a custom optimizer:

. . . 
const learningRate = 0.5;
const sgdOptimizer = tf.train.sgd(learningRate);
model.compile({loss: 'meanSquaredError', optimizer: sgdOptimizer});
. . .


To train for more epochs, you just need to provide some additional arguments to the fit() function:

. . .
model.fit(xs, ys, {
    epochs: 25,
    batchSize: 8
});
. . .


Raising the learning rate will increase the magnitude of each weight update, allowing your model to learn more quickly, but if the learning rate is too high then the model may not converge.  Raising the number of epochs allows for more weight updates, but will increase training time.