if is_singular array not working as expected

You are using an incorrect check here. is_singular() returns true when a post is from the specified post type or post types or the default post types when none is specified. You cannot target specific single posts with is_singular()

You have to use is_single to target a specific post

if ( is_single( 'post-a' ) {
    // Do something for post-a
} elseif ( is_single( 'post-b' ) {
    // Do something for post-b
}