Have u tried to use js ?
Maybe you can get both containers (stick-container) and window height. Afterwards by using foreach method you can iterate these containers. and check if one of the container's height less than window height then add aligh-top class to that container and also remove align bottom class from it.
.align-top {
align-self: start;
top: 0;
}
.align-bottom {
align-self: end;
bottom: 0;
}
inside foreach method
if (containerHeight < windowHeight) {
container.classList.add('align-top');
container.classList.remove('align-bottom');
} else {
container.classList.add('align-bottom');
container.classList.remove('align-top');
}